ClearAnimations not working?
#1

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?
Reply
#2

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)