SA-MP Forums Archive
Preloading animations - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Preloading animations (/showthread.php?tid=373728)



Preloading animations - Cypress - 31.08.2012

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?


Re: Preloading animations - HuSs3n - 31.08.2012

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


Re: Preloading animations - XGh0stz - 31.08.2012

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


Re: Preloading animations - Cypress - 31.08.2012

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.


Re: Preloading animations - Riddick94 - 31.08.2012

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?


Re: Preloading animations - HuSs3n - 31.08.2012

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); }



Re: Preloading animations - Riddick94 - 31.08.2012

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