Animation doesn't start[FIXED]
#1

Look at the code;

pawn Код:
public CheckPlayerHealth()
{
  new string[256];
  new sendername[MAX_PLAYER_NAME];
  for (new i=0; i < MAX_PLAYERS; i++)
  {
    if (IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_ONFOOT)
    {
      new Float:health;
      GetPlayerHealth(i,health);
       if(health < 20.0)
       {
         ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
        TogglePlayerControllable(i, 0);
        ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
        SetPlayerHealth(i, 20.0);
        GetPlayerName(i, sendername, sizeof(sendername));
        format(string, sizeof(string), "* %s atslēdzas un nokrīt uz zemes, jo ir ievainots", sendername);
        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        format(string, sizeof(string), "* Atslēdzies (( %s ))", sendername);
        ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        SendClientMessage(i, COLOR_RED, "Tu esi atslēdzies, gaidi mediķus vai raksti /acceptdeath");
        IsOnDeath[i] = 1;
       }
     }
  }
}
When player has under 20 HP, it automatic goes on animation, but animation doesnt start, and i want that player cant go out of animation.
Can someone help me, please?
Reply
#2

Do you have,
SetTimer("CheckPlayerHealth", 2000, 1);
Under,
OnGameModeInit?
Reply
#3

Yes i have, that function is working good, buy only animation doesnt start
Reply
#4

Код:
ApplyAnimation(i, "ped", "FALL_front", 4.0, 0, 0, 0, 0, 0);
Try this, don't ask why I changed 1 to 0
Reply
#5

Replace;
pawn Код:
ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
TogglePlayerControllable(i, 0);
ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
With
pawn Код:
TogglePlayerControllable(i, 0);
ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
ApplyAnimation(i, "ped", "FALL_front", 4.0, 1, 0, 0, 0, 0);
Reply
#6

Thanks, now it works fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)