ApplyAnimation
#1

I just can't make it work, everything works fine now at my /mask command but why ApplyAnimation doesn't trigger first time when I write /mask, it trigger only second time+ ... why not first time?

pawn Code:
CMD:mask(playerid)
{
        if(Masked[playerid] == 0)
        {
            Masked[playerid] = 1;
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.1,0,0,0,0,0);
                ShowPlayerNameTagForPlayer(i, playerid, 0);
                SetPlayerAttachedObject(playerid, 1, 19037, 2, 0.104000, 0.028000, 0.001000, 83.700035, 89.199966, 1.000000,1.000000,1.000000,1.000000,0,0);
                //AttachObjectToPlayer(Mask, playerid, 0.104000, 0.028000, 0.001000, 83.700035, 89.199966, 1.000000);
            }
            SendClientMessage(playerid, COLOR_LIGHTGREEN, "You put your Mask on!");
            return 1;
        }
        else if(Masked[playerid] == 1)
        {
            Masked[playerid] = 0;
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                ShowPlayerNameTagForPlayer(i, playerid, 1);
            }
            SendClientMessage(playerid, COLOR_LIGHTGREEN, "You took your Mask off!");
            return 1;
        }
        return 1;
}
here is the code I've made so far :P
Reply
#2

I've had the same problems, I just do ClearAnimations(playerid); before I apply the animation, works with me.
Reply
#3

This
pawn Code:
ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.1,0,0,0,0,0);
To
pawn Code:
ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.1,0,0,0,0,1);
pawn Code:
native ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync)

forcesync - Set to 1 to force playerid to sync animation with other players in all instances (optional).
Reply
#4

If Tony's and PDS' solutions do not work, try applying the animation twice.

That seems to be the only way to fix it, for me atleast.
Reply
#5

None of these work :/
Reply
#6

Try to set a timer when the player do it and apply the anim there ?
Reply
#7

Try this:

ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.1,0,0,1,0,1);
Reply
#8

Ok I tried, but still same thing, in first attempt it won't apply anim but at second or more it apply anim, I was trying everything you said guys, but still nothing :/ any other ideas?

EDIT: I made it guys I added 2x Apply animations with timers and now it's working perfect, thanks for help ^^
Reply
#9

It should work like this also and its simple without any timers
Code:
OnePlayAnim(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)