Need help with animations.
#1

Hello!

animations play a big role in my gamemode and it is crucial that they trigger as soon as you use the command.
However now, when I use the command to trigger an animation it needs to be done twice for the animation to work (first time).

Any ideas how to make it work like it should?
Reply
#2

Put the code where it says ApplyAnimation( bla bla ), Do that twice, No idea why but that should solve it
Reply
#3

Thank you!
Reply
#4

Quote:
Originally Posted by =WoR=Varth
pawn Код:
PreloadAnimLib(playerid,"BOMBER");
PreloadAnimLib(playerid,"RAPPING");
PreloadAnimLib(playerid,"SHOP");
PreloadAnimLib(playerid,"BEACH");
PreloadAnimLib(playerid,"SMOKING");
PreloadAnimLib(playerid,"FOOD");
PreloadAnimLib(playerid,"ON_LOOKERS");
PreloadAnimLib(playerid,"DEALER");
PreloadAnimLib(playerid,"CRACK");
PreloadAnimLib(playerid,"CARRY");
PreloadAnimLib(playerid,"COP_AMBIENT");
PreloadAnimLib(playerid,"PARK");
PreloadAnimLib(playerid,"INT_HOUSE");
PreloadAnimLib(playerid,"FOOD" );
PreloadAnimLib(playerid,"PED" );
Quote:
Originally Posted by Stigg
pawn Код:
PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
So your code should be something like this:
pawn Код:
public OnPlayerSpawn(playerid)
{
    PreloadAnimLib(playerid,"BOMBER");
    PreloadAnimLib(playerid,"RAPPING");
    PreloadAnimLib(playerid,"SHOP");
    PreloadAnimLib(playerid,"BEACH");
    PreloadAnimLib(playerid,"SMOKING");
    PreloadAnimLib(playerid,"FOOD");
    PreloadAnimLib(playerid,"ON_LOOKERS");
    PreloadAnimLib(playerid,"DEALER");
    PreloadAnimLib(playerid,"CRACK");
    PreloadAnimLib(playerid,"CARRY");
    PreloadAnimLib(playerid,"COP_AMBIENT");
    PreloadAnimLib(playerid,"PARK");
    PreloadAnimLib(playerid,"INT_HOUSE");
    PreloadAnimLib(playerid,"FOOD" );
    PreloadAnimLib(playerid,"PED" );
    return 1;
}

PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
Animations need to be 'loaded' in a sense, before they can be used. By applying a 'null' or empty animation from each of the categories, you are loading the animations for future use. So therefore, when you go to use an animation, it has already been loaded and will work on the first try.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)