The anim not play
#1

Hello all , i make a Command when type /cutwood to apply anim and give weapon | look:

PHP код:
CMD:cutwood(playerid,params[])
{
    if(
IsPlayerConnected(playerid))
    {
        if(
PlayerInfo[playerid][pJob] != 16) return SCM(playerid0xFFB870FF"{FFB870}Nu esti Lumberjack.");
        if(!
IsPlayerNearWood(playerid)) return SCM(playerid,COLOR_WHITE,"{FFF8C6}Nu esti la unul dintre copaci.");
        if(
woodtaie[playerid] == 0)
        {
            
GivePlayerWeapon(playerid,9,1);
            
ApplyAnimation(playerid,"CHAINSAW","WEAPON_csaw",4.1,1,0,0,0,1);
            
            
woodtaie[playerid] = 1;
            
SetTimerEx("WoodTaie",7000,false,"d",playerid);
        }
        else
        {
            
SendClientMessage(playerid,-1,"Tu tai deja un copac.");
        }
    }
    return 
1;

BUT the anim not play
Reply
#2

You need to preload all the animation libraries you use first.
pawn Код:
stock PreloadAnimLib(playerid, animlib[])
    ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
Then put this under OnPlayerSpawn or so:
pawn Код:
PreloadAnimLib(playerid, "CHAINSAW");
You must do this for every animation you use to work all of them.
Reply
#3

More easier way of preloading anims

PHP код:
// Somewhere in your script
static const AnimLibs[][] =
{
    
"BOMBER""RAPPING""SHOP""BEACH""SMOKING""FOOD""ON_LOOKERS",
    
"DEALER""CRACK""CARRY""COP_AMBIENT""PARK""INT_HOUSE""FOOD",
    
"DANCING""ped""TEC""CASINO""VENDING""HEIST9""PARACHUTE",
    
"GYMNASIUM""MISC""SWORD""CHAINSAW"
};
PreloadAnimLibFor(id)
{
    for(new 
0len sizeof(AnimLibs); leni++)
    {
        
ApplyAnimation(idAnimLibs[i], "null"0.0000000);
    }
}
// OnPlayerConnect
PreloadAnimLibFor(playerid); 
Probably better than his way, you'll be using way less lines if you want to preload more animations.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)