ANIMATION x@
#1

Can somebody tell me how to fix animation problem, it only works when i type the command 2 times, not from the first time.
Reply
#2

Can you define the 'animation problem' for us please?
Reply
#3

Quote:
Originally Posted by Loot
Посмотреть сообщение
Can you define the 'animation problem' for us please?
He says here:
(Unless he edited it in after)

Quote:

it only works when i type the command 2 times, not from the first time.

I personally don't know how to solve this though.
Reply
#4

pawn Код:
stock PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
Pre-load the animation before using it. So check if the player spawns for first time (in OnPlayerSpawn) and pre-load the animation(s) you want to use.
Reply
#5

Show as the error and the line. (without lines how we will fix it.)
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
stock PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
Pre-load the animation before using it. So check if the player spawns for first time (in OnPlayerSpawn) and pre-load the animation(s) you want to use.
you mean i have to put this stock, and put under OnPlayerSpawn:
pawn Код:
PreloadAnimLib(playerid, animlib[]);
Reply
#7

No. An example, let's say you want to use the animlib of PED.
pawn Код:
// global:
new
    bool: First_Spawn[ MAX_PLAYERS char ]
;

// OnPlayerConnect:
First_Spawn{ playerid } = true;

// OnPlayerSpawn:
if( First_Spawn{ playerid } )
{
    PreloadAnimLib( playerid, "PED" );
    First_Spawn{ playerid } = false;
}

// Where you want to use the animation
ApplyAnimation( playerid, "PED", "cower", 1, 1, 0, 0, 0, 0, 1 );

// at the bottom:
stock PreloadAnimLib( playerid, animlib[ ] )
{
    ApplyAnimation( playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0) ;
}
That will preload the animation the first time you'll spawn so you can use it later.
Reply
#8

the stock must be at the bottom ? and it just includes 1 "apply animation" ?
Reply
#9

you can put the stock anywhere but I suggest you to put all of your stocks on the bottom of your script, you can find them easier. When you use ApplyAnimation with 'null' as a animation name, you won't have to do animations from some library again. For example, if you write in your code this:
pawn Код:
ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
all animations from BEACH library will work in the first time you write your command with those animations, but all the other libraries aren't 'loaded', so you can create another stock which will load all animation libraries that you need.
pawn Код:
stock PreloadAnimLib(playerid, animlib[])
{
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
}
stock PreloadAllAnimLibs(playerid)
{
    PreloadAnimLib(playerid,"BEACH");
    PreloadAnimLib(playerid,"FAT");
    PreloadAnimLib(playerid,"ped");
    PreloadAnimLib(playerid,"Attractors");
    PreloadAnimLib(playerid,"CRIB");
    PreloadAnimLib(playerid,"MISC");
    PreloadAnimLib(playerid,"INT_HOUSE");
... and so on
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)