Question about Health
#1

I've made a system that if a player dies they go to the hospital and heal. (I set their health on spawn to 5).

My question is, is this code going to work for large ammounts of people healing:

pawn Код:
if(PlayerHealing[i] > 0) // This is being called by a 1000ms timer.
{
   new Float:PlayerHealth;
   GetPlayerHealth(i,PlayerHealth);
   SetPlayerHealth(i,PlayerHealth + 5);
   if(PlayerHealth >= 95)
   {
    PlayerHealing[i] = 0;
    GivePlayerCash(i, -10);
    SetCameraBehindPlayer(i);
    TogglePlayerControllable(i,1);
   }
}
Because often some people spawn with 100 health without even taking the time to heal.

Thank you for your answers.
Reply
#2

If you have SetPlayerHealth(playerid, 5); and you loop through all players in the timer then it will work
Reply
#3

Quote:
Originally Posted by dice7
If you have SetPlayerHealth(playerid, 5); and you loop through all players in the timer then it will work
Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)