ApplyActorAnimation Help
#1

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!
Reply
#2

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

Reply
#3

You need to preload the animations for the player seeing the animation.
Reply
#4

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You need to preload the animations for the player seeing the animation.
How?
Reply
#5

You'll need the preloadanimlib function, i'll try and find it later.
Reply
#6

You need to preload the animations for the actor.

Add this code in your script:
Код:
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.
Код:
PreloadActorAnimations(actorid);
{
Thanks to Emmet_ for his code.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)