Healing problem
#1

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
Reply
#2

Paste that code on OnPlayerUpdate

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

Any other callback ? I mean if i use it @OnplayerUpdate it will be called many times because of that command,And server might lag
Reply
#4

You could try making your own callback for that and user a timer which calls the callback every 10 seconds, for example?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)