I need help about health - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I need help about health (
/showthread.php?tid=536728)
I need help about health -
vannesenn - 11.09.2014
Hi guys,
I have a problem with adding Health to player. I made re-heathing system. So, if is Health below 75.00%, server will add 0.750% every 15 seconds. But, my code don't work... See code below
Код:
new Float:_pHP;
GetPlayerHealth(_playerid, _pHP);
if(_pHP <= _REHEALTH_MIN_VALUE)
{
new Float:_new_pHP = floatadd(_REHEALTH_VALUE / 2, _REHEALTH_VALUE / 2) + _pHP;
SetPlayerHealth(_playerid, _new_pHP);
va_SendClientMessage(_playerid, -1, "- Rehealthan si || %f + %f = %f", _pHP, _new_pHP, _pHP + _new_pHP);
}
See chatlog(for searching for bugs)
Quote:
11:03:07] - Rehealthan si || 36.000000 + 36.720001 = 72.720001
[11:03:23] - Rehealthan si || 36.000000 + 36.720001 = 72.720001
|
So, how I can make system which will give 0.750% hp on my current hp?
Thanks You
Re: I need help about health -
vannesenn - 13.09.2014
Somebody help?