Quote:
Originally Posted by mSp
pawn Code:
forward CheckHealth(); public CheckHealth() { for(new i = 0; i < MAX_PLAYERS; i++) { new Float:health; GetPlayerHealth(i,health); if(health <= 20) { ApplyAnimation(i, "ped", "KO_spin_L", 4.1, 1, 1, 1, 1, 1, 1); TogglePlayerControllable(i,0); } } return 1; }
Not tested though..anyways would be better to use OnPlayerUpdate for health checking since it checks health very frequently
|
Ok... We tested it with 2 people, and now it works for everyone. But one question - How the heck my character keeps doing the animation all the time? It spins like 2 times in a second.. I think it's because of this?
pawn Code:
HealthTimer = SetTimer("CheckHealth",500, true);
That's under OnGameModeInIt.