SA-MP Forums Archive
ApplyAnimation in vehicles - 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: ApplyAnimation in vehicles (/showthread.php?tid=601991)



ApplyAnimation in vehicles - CalvinC - 29.02.2016

When i'm trying to apply animations inside vehicles, it doesn't work if i accelerated/reversed before, the player just makes a short twitch.
But if i shortly hold down W and S at the same time, the animation works fine afterwards, but if i then accelerate or reverse a bit again i have to do it again.
That's the best i can explain it, but does anyone know how to fix this bug?


Re: ApplyAnimation in vehicles - N0FeaR - 29.02.2016

Can u show me code how u done it?


Re: ApplyAnimation in vehicles - CalvinC - 29.02.2016

Quote:
Originally Posted by N0FeaR
View Post
Can u show me code how u done it?
An example is:

Code:
LoopingAnim(playerid, "CAR", "Sit_relaxed", 4.1, 0, 0, 0, 1, 1);
Code:
LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, freeze, time)
{
    ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, freeze, time, 1);
}



Re: ApplyAnimation in vehicles - CalvinC - 01.03.2016

Bump.
EDIT: Animations also works if you hold down the handbrake a bit, so it might just be when the client is 100% sure the vehicle is fully stopped perhaps.


Re: ApplyAnimation in vehicles - [NWA]Hannes - 01.03.2016

Does it work fine in passenger seats? If that's the case then the game applies a new animation to the player when you press W/S and so on. Try debugging it with something like creating a new function called OnPlayerAnimationChange under OnPlayerUpdate where you use GetPlayerAnimationIndex and check if it updates when you're in a car, might spam your screen though.


Re: ApplyAnimation in vehicles - CalvinC - 02.03.2016

Tried adding
Code:
ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1);
to reset the animation before using the actual animation, still doesn't work though, same issue.

I tried GetPlayerAnimationIndex, but it just returns 0 in vehicles, as also seen here:
https://sampforum.blast.hk/showthread.php?tid=522930


Re: ApplyAnimation in vehicles - CalvinC - 03.03.2016

Bump.


Re: ApplyAnimation in vehicles - CalvinC - 04.03.2016

Bump.


Re: ApplyAnimation in vehicles - CalvinC - 05.03.2016

Bump, nobody knows how to fix this?