ApplyAnimation - PROBLEM
#1

Hello, I have a problem with ApplyAnimation function. When I use:

pawn Code:
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 1.0, 0, 1, 1, 1, 0);
In my command, the function doesn't work in first execution, then if I execute the command again, the function work normaly.

Anyone know why?

Thanks and sorry from my bad english.
Reply
#2

It's a SA-MP issue.
You have to apply nearly every animation twice before it works.
Reply
#3

Holy shit... '-'

Ok, thanks
Reply
#4

It's a GTA issue. You have to pre-load the animtion library to apply animations from it. One solution is to, as Drebin stated, apply animations twice. You could make a custom function for this for ease:

pawn Code:
stock ApplyPlayerAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
{
    ApplyAnimation(playerid, animlib, "null", fDelta, loop, lockx, locky, freeze, time, forcesync); // Pre-load animation library
    return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}
Use ApplyPlayerAnimation instead of ApplyAnimation. [not tested.]
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)