Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Check health  (Read 1521 times)

0 Members and 1 Guest are viewing this topic.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Check health
« on: 24 Jul 2009, 12:29:37 »
Hey all

Is there a script around that can tell a player how much health they have left? Preferably in a percentage like 'You have 50% health' or something.

Any help would be appreciated

Gruntage
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline dr. seltsam

  • Members
  • *
Re: Check health
« Reply #1 on: 24 Jul 2009, 15:30:10 »
Yes...

make an Init.sqs with the following content:
Code: [Select]
ch=player addAction ["Check Health","Status.sqs"]

Then make the Status.sqs:
Code: [Select]
_u=_this select 0

_h=1-damage _u
_h=_h*100+0.5
_h=_h-_h mod 1

hint format [(name _u)+"\n\nYour health is:\n%1%2",_h,"%"]
exit

 :)
« Last Edit: 24 Jul 2009, 15:32:15 by dr. seltsam »

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Check health
« Reply #2 on: 24 Jul 2009, 16:41:31 »
Thanx a lot  :D :D :D
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba