Preloading animations
#1

Hello,

I have an animation that does not work from the 1st time. It does not getting preloaded.

pawn Код:
ApplyAnimation(playerid, "SWEET", "sweet_injuredloop", 4.1, 0, 0, 0, 1, 0, 1);
I have used the gl_actions filterscript. It didn't help.

Is there any other way of how I can fix this?
Reply
#2

add this under onplayerspawn
ApplyAnimation(playerid,"SWEET","null",0.0,0,0,0,0 ,0);
Reply
#3

I know that if you run a animation quite a few times (Such as in a loop), it'll then work. However, this might not be the best method to handle the problem, but still the only way I know how to resolve it

EDIT: Well if the above post works, then go with that
Reply
#4

Quote:
Originally Posted by HuSs3n
Посмотреть сообщение
add this under onplayerspawn
ApplyAnimation(playerid,"SWEET","null",0.0,0,0,0,0 ,0);
Yh, this one was really a simple way. I was wondering if it matters on calling this thing every time a player spawns.

1000 times spawned 1000 times null.
Reply
#5

Em.. i know how to preload animations.. but maybe there's some way to do not lag when there's a preety a bit more animations to preload?
Reply
#6

well ,if you feel its too much ,you can add it under onplayerconnect instead

i personally do this for the anims that i use
pawn Код:
public OnPlayerConnect(playerid)
{
   PreloadAnims(playerid);
}


stock PreloadAnims(playerid)
{
    PreloadAnimLib(playerid,"DANCING");
    PreloadAnimLib(playerid,"HEIST9");
    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" );
    PreloadAnimLib(playerid,"MISC" );
    PreloadAnimLib(playerid,"POLICE" );
    PreloadAnimLib(playerid,"GRAVEYARD" );
    PreloadAnimLib(playerid,"WUZI" );
    PreloadAnimLib(playerid,"SUNBATHE" );
    PreloadAnimLib(playerid,"PLAYIDLES" );
    PreloadAnimLib(playerid,"CAMERA" );
    PreloadAnimLib(playerid,"RIOT" );
    PreloadAnimLib(playerid,"DAM_JUMP" );
    PreloadAnimLib(playerid,"JST_BUISNESS" );
    PreloadAnimLib(playerid,"KISSING" );
    PreloadAnimLib(playerid,"GANGS" );
    PreloadAnimLib(playerid,"GHANDS" );
    PreloadAnimLib(playerid,"BLOWJOBZ" );
    PreloadAnimLib(playerid,"SWEET" );
}

stock PreloadAnimLib(playerid, animlib[]) {
ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0); }
Reply
#7

Tihink.. it will lag when player connect.. if you don't tested something and you don't know how it works.. leave it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)