public OnPlayerUpdate(playerid) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { new w = GetPlayerWeapon(playerid); if(w == 25 || w == 27 || w == 30 || w == 31 || w == 33 || w == 34) { if(GetPlayerSpeed(playerid, true) >= 1) { ApplyAnimation(playerid, "PED", "RUN_ARMED", 4.1, 0, 1, 1, 0, 0); } else { ApplyAnimation(playerid, "PED", "IDLE_ARMED", 4.1, 0, 1, 1, 0, 0); } } } return 1; }
ApplyAnimation(playerid, "PED", "RUN_ARMED", 4.1, 0, 1, 1, 0, 0);
ApplyAnimation(playerid, "PED", "IDLE_ARMED", 4.1, 0, 1, 1, 0, 0);
UsePlayerPedAnims();
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { new w = GetPlayerWeapon(playerid); if(w == 25 || w == 27 || w == 30 || w == 31 || w == 33 || w == 34) { if(GetPlayerSpeed(playerid, true) >= 1) { if(GetPlayerAnimationIndex(playerid) != 1223) ApplyAnimation(playerid, "PED", "RUN_ARMED", 4.1, 0, 1, 1, 0, 0); } else { if(GetPlayerAnimationIndex(playerid) != 1183) ApplyAnimation(playerid, "PED", "IDLE_ARMED", 4.1, 0, 1, 1, 0, 0); } } }
This callback is called, on average, 30 times per second, per player; only use it when you know what it's meant for (or more importantly what it's NOT meant for). |
https://sampwiki.blast.hk/wiki/OnPlayerUpdate
You are setting the animation for a player 30 times/s. |
But why it's repeating with this if?
if(GetPlayerAnimationIndex(playerid) != 1223) ~~ if(GetPlayerAnimationIndex(playerid) != 1183) |