SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/02/2016, 07:16 PM   #1
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default ApplyAnimation in vehicles

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?
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 29/02/2016, 07:33 PM   #2
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,304
Reputation: 167
Default Re: ApplyAnimation in vehicles

Can u show me code how u done it?
__________________
Here is my discord server https://discord.gg/ucVpDkJ
N0FeaR is offline   Reply With Quote
Old 29/02/2016, 08:08 PM   #3
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: ApplyAnimation in vehicles

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);
}
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 01/03/2016, 05:34 PM   #4
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: ApplyAnimation in vehicles

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.
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.

Last edited by CalvinC; 01/03/2016 at 07:05 PM.
CalvinC is offline   Reply With Quote
Old 01/03/2016, 08:25 PM   #5
[NWA]Hannes
Huge Clucker
 
[NWA]Hannes's Avatar
 
Join Date: Jul 2010
Location: Sweden
Posts: 341
Reputation: 12
Default Re: ApplyAnimation in vehicles

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.
__________________
Mostly inactive.

My old account is bajskorv123. (Now I have a low post count)
[NWA]Hannes is offline   Reply With Quote
Old 02/03/2016, 05:17 AM   #6
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: ApplyAnimation in vehicles

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:
http://forum.sa-mp.com/showthread.php?t=522930
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 03/03/2016, 04:07 AM   #7
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: ApplyAnimation in vehicles

Bump.
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 04/03/2016, 08:46 AM   #8
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: ApplyAnimation in vehicles

Bump.
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 05/03/2016, 08:19 AM   #9
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,831
Reputation: 114
Default Re: ApplyAnimation in vehicles

Bump, nobody knows how to fix this?
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A bit help with ApplyAnimation qazwsx Scripting Help 1 19/11/2013 08:25 AM
ApplyAnimation Lajko1 Scripting Help 8 10/10/2013 06:47 PM
ApplyAnimation Da_Noob Scripting Help 2 30/01/2013 08:18 PM
ApplyAnimation Incubator Help Archive 1 02/08/2011 02:06 AM


All times are GMT. The time now is 09:51 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.