08.04.2012, 12:59
So I decided to make a timer, where every second, the game checks if your health goes under 20, when it does, you slowly begin to bleedout and have to call the EMS, only problem is, it doesn't work.
It compiles fine, I just die.
^ Under OnPlayerSpawn
pawn Код:
public Dying() {
foreach(Player, x) {
if(playerVariables[x][pHealth] <= 20)
{
playerVariables[x][pBleedingOut] = 1;
ApplyAnimation(x, "SWAT", "gnstwall_injurd", 4.0, 1, 0, 0, 0, 0);
TogglePlayerControllable(x, 0);
playerVariables[x][pHealth] -= 10;
}
}
}
pawn Код:
SetTimer("Dying", 1, true);