Help me about animation
#9

Would this be of any use?

Quote:
Originally Posted by bartekdvd
Посмотреть сообщение
Here is an example:
pawn Код:
#include <a_samp>

bool:HasAnimationApplied(playerid, animlib[], animname[])
{
    new l_animlib[32];
    new l_animname[32];
    GetAnimationName(GetPlayerAnimationIndex(playerid),l_animlib,32,l_animname,32);
    if (strcmp(animlib, l_animlib, true) == 0 && strcmp(animname, l_animname, true) == 0)
        return true;
    return false;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    else if (strcmp("/up", cmdtext, true, 3) == 0)
    {
        ApplyAnimation(playerid, "PED", "HANDSUP", 4.1, 0, 0, 0, 1, 0, 1);
        return 1;
    }
    else if (strcmp("/down", cmdtext, true, 5) == 0)
    {
         ClearAnimations(playerid);
         return 1;
    }
    else if (strcmp("/isup", cmdtext, true, 5) == 0 )
    {
        if (HasAnimationApplied(playerid, "PED", "HANDSUP"))
            SendClientMessage(playerid, 0xFFFFFFFF, "HANDSUP");
        else
            SendClientMessage(playerid, 0xFFFFFFFF, "HANDSDOWN");
           
        return 1;
    }
    return 0;
}
I have tested it.
See the commands he's added so you can get an idea of how to use it.

pawn Код:
if(HasAnimationApplied(playerid, "BD_FIRE", "wash_up"))
{
    //They do.
}
else
{
    //They don't.
}
Reply


Messages In This Thread
Help me about animation - by hoanduy - 25.02.2018, 13:22
Re: Help me about animation - by RogueDrifter - 25.02.2018, 13:32
Re: Help me about animation - by hoanduy - 25.02.2018, 13:43
Re: Help me about animation - by RogueDrifter - 25.02.2018, 14:06
Re: Help me about animation - by hoanduy - 25.02.2018, 14:11
Re: Help me about animation - by hoanduy - 25.02.2018, 14:35
Re: Help me about animation - by RogueDrifter - 25.02.2018, 15:49
Re: Help me about animation - by hoanduy - 26.02.2018, 04:02
Re: Help me about animation - by DobbysGamertag - 26.02.2018, 04:18
Re: Help me about animation - by Dayrion - 26.02.2018, 07:38

Forum Jump:


Users browsing this thread: 1 Guest(s)