21.11.2009, 13:41
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:
Because often some people spawn with 100 health without even taking the time to heal.
Thank you for your answers.
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);
}
}
Thank you for your answers.