Holding object and animations - 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: Holding object and animations (
/showthread.php?tid=366391)
Holding object and animations -
Jack_Leslie - 06.08.2012
Hi guys,
I'm currently working on a new system, but I'm struggling with a couple of things. I'm making a system where you collect a package, and you have to carry it. Here's the code I used for attaching the object and making the carry animation:
pawn Код:
SetPlayerAttachedObject( playerid, 9, 1575, 1, -0.064613, 0.520760, 0.000000, 0.000000, 84.217391, 0.000000, 1.000000, 1.000000, 1.000000 );
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 1, 1, 1, 1, 1);
That bit its self works, but then there's bugs after it. If I sprint, the animation stops so the package just floats on the player. If I jump, it does the same thing, so I've got it if you jump and/or sprint you drop the package and the animation stops. Dropping the package works, but the stopping the animation either freezes the player in the animation, or keeps the animation going but doesn't freeze you.
I use this code to stop the animation:
pawn Код:
StopLoopingAnim(playerid)
{
gPlayerUsingLoopingAnim[playerid] = 0;
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
}
I also use the default ClearAnimations(playerid); call.
I can't see why it wouldn't stop the animation and why it would freeze the player in some cases.
Re: Holding object and animations -
Jack_Leslie - 08.08.2012
Bump?