SA-MP Forums Archive
Animation doesn't start[FIXED] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Animation doesn't start[FIXED] (/showthread.php?tid=154367)



Animation doesn't start[FIXED] - Bumbis - 13.06.2010

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?



Re: Animation doesn't start - Lynn - 13.06.2010

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


Re: Animation doesn't start - Bumbis - 13.06.2010

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


Re: Animation doesn't start - Thrarod - 13.06.2010

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


Re: Animation doesn't start - Lynn - 13.06.2010

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);



Re: Animation doesn't start - Bumbis - 13.06.2010

Thanks, now it works fine