OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Gruntage on 24 Jul 2009, 12:29:37

Title: Check health
Post by: Gruntage 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
Title: Re: Check health
Post by: dr. seltsam 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

 :)
Title: Re: Check health
Post by: Gruntage on 24 Jul 2009, 16:41:31
Thanx a lot  :D :D :D