ApplyAnimation in vehicles
#1

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

Can u show me code how u done it?
Reply
#3

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);
}
Reply
#4

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.
Reply
#5

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.
Reply
#6

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

Bump.
Reply
#8

Bump.
Reply
#9

Bump, nobody knows how to fix this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)