Healing problem - 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: Healing problem (
/showthread.php?tid=507139)
Healing problem -
RoleplayEditor - 16.04.2014
I tried making a code if player health is lower than 20 he should get healed.
pawn Код:
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 30.0)
{
SetPlayerHealth(playerid,100);
}
I use OnPlayerTakeDamage callback for the code.
Am i using wrong callback or something wrong with my code. Hoping for help asap. Thanks
Re: Healing problem -
Hanuman - 16.04.2014
Paste that code on OnPlayerUpdate
And here should be 20 instead of 30 if(health <
30.0)
Re: Healing problem -
RoleplayEditor - 16.04.2014
Any other callback ? I mean if i use it @OnplayerUpdate it will be called many times because of that command,And server might lag
Re: Healing problem -
PrivatioBoni - 16.04.2014
You could try making your own callback for that and user a timer which calls the callback every 10 seconds, for example?