[HELP] Creating a new command...
#9

Quote:
Originally Posted by mSp
View Post
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.
Reply


Messages In This Thread
[HELP] Creating a new command... [STILL NEED HELP] - by Da' J' - 19.01.2012, 16:41
Re: [HELP] Creating a new command... - by milanosie - 19.01.2012, 16:44
Re: [HELP] Creating a new command... - by Konstantinos - 19.01.2012, 16:55
Re: [HELP] Creating a new command... - by milanosie - 19.01.2012, 17:14
Re: [HELP] Creating a new command... - by Konstantinos - 19.01.2012, 17:26
Re: [HELP] Creating a new command... - by milanosie - 19.01.2012, 18:10
Re: [HELP] Creating a new command... - by Da' J' - 19.01.2012, 18:11
Re: [HELP] Creating a new command... - by mSp - 19.01.2012, 18:22
Re: [HELP] Creating a new command... - by Da' J' - 19.01.2012, 18:44
Re: [HELP] Creating a new command... - by mSp - 19.01.2012, 18:51

Forum Jump:


Users browsing this thread: 3 Guest(s)