PDA

View Full Version : Healing problem


RoleplayEditor
16/04/2014, 09:58 AM
I tried making a code if player health is lower than 20 he should get healed.



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

Hanuman
16/04/2014, 10:02 AM
Paste that code on OnPlayerUpdate

And here should be 20 instead of 30 if(health < 30.0)

RoleplayEditor
16/04/2014, 10:12 AM
Any other callback ? I mean if i use it @OnplayerUpdate it will be called many times because of that command,And server might lag

PrivatioBoni
16/04/2014, 10:28 AM
You could try making your own callback for that and user a timer which calls the callback every 10 seconds, for example?