SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > 0.3.7 RC Scripting

 
 
Thread Tools Display Modes
Old 31/05/2015, 08:13 AM   #1
WinterKiller
Little Clucker
 
Join Date: Apr 2015
Location: Cluj-Napoca, Romania
Posts: 3
Reputation: 0
Question ApplyActorAnimation Help

Hi everyone!
I'm beginner with the scripting and I need some help at ApplyActorAnimation. For me ApplyActorAnimation doesn't work...The actor is at the correct location, but makes no anim.

ScreenShots: http://puu.sh/i6ULn/9b728a79f3.png
http://puu.sh/i6UMM/2f762de69f.png

Thanks for your time!
WinterKiller is offline  
Old 01/06/2015, 12:07 AM   #2
IgorLuiz
Huge Clucker
 
IgorLuiz's Avatar
 
Join Date: Mar 2015
Location: São Paulo
Posts: 489
Reputation: 31
Default Re: ApplyActorAnimation Help

Try this code! sure if you change the anim!

Quote:
new Actor;
Quote:
public OnGameModeInit()
{
Actor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Actor as salesperson in Ammunation
ApplyActorAnimation(Actor, "DEALER", "shop_pay", 4.1, 0, 0, 0, 0, 0); // Pay anim
return 1;
}

IgorLuiz is offline  
Old 01/06/2015, 12:09 AM   #3
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,302
Reputation: 386
Default Re: ApplyActorAnimation Help

You need to preload the animations for the player seeing the animation.
Abagail is offline  
Old 03/06/2015, 09:06 AM   #4
WinterKiller
Little Clucker
 
Join Date: Apr 2015
Location: Cluj-Napoca, Romania
Posts: 3
Reputation: 0
Default Re: ApplyActorAnimation Help

Quote:
Originally Posted by Abagail View Post
You need to preload the animations for the player seeing the animation.
How?
WinterKiller is offline  
Old 03/06/2015, 09:26 AM   #5
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: England
Posts: 4,041
Reputation: 339
Default Re: ApplyActorAnimation Help

You'll need the preloadanimlib function, i'll try and find it later.
__________________
Luis- is offline  
Old 04/06/2015, 04:25 AM   #6
Admigo
High-roller
 
Admigo's Avatar
 
Join Date: Oct 2010
Location: The Netherlands
Posts: 2,016
Reputation: 267
Default Re: ApplyActorAnimation Help

You need to preload the animations for the actor.

Add this code in your script:
Code:
static s_AnimationLibraries[][] = {
        !"AIRPORT",    !"ATTRACTORS",   !"BAR",                 !"BASEBALL",
        !"BD_FIRE",    !"BEACH",            !"BENCHPRESS",  !"BF_INJECTION",
        !"BIKED",          !"BIKEH",        !"BIKELEAP",        !"BIKES",
        !"BIKEV",          !"BIKE_DBZ",     !"BMX",             !"BOMBER",
        !"BOX",            !"BSKTBALL",     !"BUDDY",           !"BUS",
        !"CAMERA",         !"CAR",          !"CARRY",           !"CAR_CHAT",
        !"CASINO",         !"CHAINSAW",     !"CHOPPA",          !"CLOTHES",
        !"COACH",          !"COLT45",       !"COP_AMBIENT", !"COP_DVBYZ",
        !"CRACK",          !"CRIB",         !"DAM_JUMP",         !"DANCING",
        !"DEALER",         !"DILDO",        !"DODGE",            !"DOZER",
        !"DRIVEBYS",   !"FAT",          !"FIGHT_B",      !"FIGHT_C",
        !"FIGHT_D",    !"FIGHT_E",      !"FINALE",               !"FINALE2",
        !"FLAME",      !"FLOWERS",      !"FOOD",                 !"FREEWEIGHTS",
        !"GANGS",      !"GHANDS",       !"GHETTO_DB",    !"GOGGLES",
        !"GRAFFITI",   !"GRAVEYARD",    !"GRENADE",      !"GYMNASIUM",
        !"HAIRCUTS",   !"HEIST9",       !"INT_HOUSE",    !"INT_OFFICE",
        !"INT_SHOP",   !"JST_BUISNESS", !"KART",                 !"KISSING",
        !"KNIFE",      !"LAPDAN1",              !"LAPDAN2",      !"LAPDAN3",
        !"LOWRIDER",   !"MD_CHASE",     !"MD_END",               !"MEDIC",
        !"MISC",       !"MTB",                  !"MUSCULAR",     !"NEVADA",
        !"ON_LOOKERS", !"OTB",                  !"PARACHUTE",    !"PARK",
        !"PAULNMAC",   !"PED",                  !"PLAYER_DVBYS", !"PLAYIDLES",
        !"POLICE",     !"POOL",                 !"POOR",                 !"PYTHON",
        !"QUAD",       !"QUAD_DBZ",     !"RAPPING",      !"RIFLE",
        !"RIOT",       !"ROB_BANK",     !"ROCKET",               !"RUSTLER",
        !"RYDER",      !"SCRATCHING",   !"SHAMAL",               !"SHOP",
        !"SHOTGUN",    !"SILENCED",     !"SKATE",                !"SMOKING",
        !"SNIPER",     !"SPRAYCAN",     !"STRIP",                !"SUNBATHE",
        !"SWAT",       !"SWEET",                !"SWIM",                 !"SWORD",
        !"TANK",       !"TATTOOS",              !"TEC",                  !"TRAIN",
        !"TRUCK",      !"UZI",                  !"VAN",                  !"VENDING",
        !"VORTEX",     !"WAYFARER",     !"WEAPONS",      !"WUZI",
        !"WOP",        !"GFUNK",                !"RUNNINGMAN"
};

stock static PreloadActorAnimations(actorid)
{
        for(new i = 0; i < sizeof(s_AnimationLibraries); i ++)
        {
            ApplyActorAnimation(actorid, s_AnimationLibraries[i], "null", 0.0, 0, 0, 0, 0, 0);
        }
}
Then use the preload function after you created the actor.
Code:
PreloadActorAnimations(actorid);
{
Thanks to Emmet_ for his code.
__________________


Last edited by Admigo; 04/06/2015 at 07:51 AM.
Admigo is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 09:14 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.