Carry animation
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Create a box object using CreateObject(or preferably using a streamer plug-in).

Then to make them "carry" the object, you'd need to find offsets for the skins you're intending on carrying said box. Then attach the box object using AttachObjectToPlayer accordingly. Then, use SPECIAL_ACTION_CARRY to set them in the carrying animation.

This might help you get started:
pawn Код:
SetPlayerCarry(playerid, bool: toggle)
{
    if(!IsPlayerConnected(playerid)) return INVALID_PLAYER_ID;
    if(toggle == true)
    {
          SetPVarInt(playerid, "is_carrying_box", 1);
          SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
          return 1;
    }
    else
    {
          SetPVarInt(playerid, "is_carrying_box", 0);
          SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
          return 1;
    }
    return -1;
}

IsPlayerCarryingBox(playerid)
{
    if(GetPVarInt(playerid, "is_carrying_box"))
    {
         return 1;
    }
    return 0;
}
How about we add less spice to this code?

For someone who knows what they are doing

pawn Код:
SetPlayerCarry(playerid, bool:toggle)
{
    if(!IsPlayerConnected(playerid)) return 0;
    return SetPlayerSpecialAction(playerid, (toggle == true) ? SPECIAL_ACTION_CARRY : SPECIAL_ACTION_NONE);
}

IsPlayerCarryingBox(playerid) return GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY;
For someone who doesn't know what they are doing

pawn Код:
SetPlayerCarry(playerid, bool:toggle)
{
    if(!IsPlayerConnected(playerid)) return 0;
    if(toggle == true && GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_CARRY)
    {
          SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
    }
    else
    {
          SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
    }
    return 1;
}

IsPlayerCarryingBox(playerid)
{
    if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY)
        return 1;
    return 0;
}
Reply


Messages In This Thread
Carry animation - by jeffery30162 - 30.01.2015, 01:09
Re: Carry animation - by Abagail - 30.01.2015, 01:13
Re: Carry animation - by ikey07 - 30.01.2015, 01:15
Re: Carry animation - by jeffery30162 - 30.01.2015, 01:45
Re: Carry animation - by Kar - 30.01.2015, 02:34

Forum Jump:


Users browsing this thread: 1 Guest(s)