GetPlayerAnimationIndex doesn't work on looped anims - 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)
+--- Thread: GetPlayerAnimationIndex doesn't work on looped anims (
/showthread.php?tid=662077)
GetPlayerAnimationIndex doesn't work on looped anims -
Nyzenic - 23.12.2018
I'm using this filterscript to debug the anims
https://sampforum.blast.hk/showthread.php?tid=182937, i just added animationindex value to the message
Tried this with 2 animations
Code:
ApplyAnimation(playerid,"MUSCULAR","MuscleSprint",4.0,1,1,1,1,1,1);
// and
ApplyAnimation(playerid,"PED", "WALK_DRUNK",4.0,1,1,1,1,1,1);
images:
https://imgur.com/a/TFYwruS
I was trying to make my custom sprint anim non-exploitable by adding some detections like getting the animation IDs but then I noticed that the animation doesn't stop when I release space. Animation 910 is MuscleSprint
Code:
if(RELEASED( KEY_SPRINT ) && GetPlayerAnimationIndex(playerid) == 910)
{
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1);
}
Is this a SA-MP bug or just something wrong with my script?
edit: i removed the loop and it showed up
https://i.imgur.com/uwq33fy.png
but i need the loop so that the players can go left and right without stopping the sprint animation