SA-MP Forums Archive
ClearAnimations not working? - 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: ClearAnimations not working? (/showthread.php?tid=149927)



ClearAnimations not working? - yeswecanchange09 - 24.05.2010

Should be so simple, I've wasted hours messing with every option I can think of but the player I arrest keeps spawning in jail with the handsup animation still applied.

In the arrest command I have:

pawn Код:
SetTimerEx("SendToJail",2000,0,"d",giveplayerid);
TogglePlayerControllable(giveplayerid,0);
ApplyAnimation(giveplayerid,"PED","handsup",4.1,0,1,1,1,1);
In SendToJail I have tried everything I can think of, I tried:

ClearAnimations(playerid);
ClearAnimations(playerid);

I tried applying other animations, I tried TogglePlayerControllable(playerid,1); before ClearAnimations, and I've tried putting it after.

I also tried using the handsup SetPlayerSpecialAction instead of ApplyAnimation which does work, but the arrested player can move before hes sent to jail which I don't want. SetPlayerSpecialAction seems to unfreeze him from TogglePlayerControllable in the two seconds before hes sent to jail.

I also tried messing with some of the ApplyAnimation parameters like turning of loop, and turning off opt4 freezing the animation when complete, but then the animation doesn't play at all during the arrest.

I realize the player can just punch to stop the animation once hes in jail, but it just doesn't look right, and the player shouldn't have to.

Should be so simple, is this just bugged? Or do you know of a solution I'm over looking?


Re: ClearAnimations not working? - DJDhan - 24.05.2010

If you used the method and order for other animations, do they work right?


Re: ClearAnimations not working? - Conroy - 24.05.2010

I don't think it would work if you're using playerid. Try this:

pawn Код:
forward SendToJail(id);
pawn Код:
//Jail command
SetTimerEx("SendToJail",2000,0,"i",giveplayerid); //Changed "d" to "i" since the ID is an integer
TogglePlayerControllable(giveplayerid,0);
ApplyAnimation(giveplayerid,"PED","handsup",4.1,0,1,1,1,1);
pawn Код:
public SendToJail(id)
{
ClearAnimations(id);
return 1;
}