Attached Object!
#1

Hey, i got add command for attached object, but how to i remove ? i readed alredy WIKI, but didnt understand though.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
Adding Bag

pawn Код:
if (strcmp("/bag", cmdtext, true, 10) == 0)
        {
    SetPlayerAttachedObject(playerid, 3, 1550, 1, 0.1, -0.3, 0, 0, 40, 0, 1, 1, 1);
    return 1;
        }
        return 0;
Removing Bag

pawn Код:
{
    if(!strmp(cmdtext, "/removebag", true))
    {
        for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
        }
        return 1;
    }
    }
    return 0;
}
but it ofc dont work... any can help ?
Reply
#2

You mean the compiler compiles with errors or the command doesn't work? There's appears to be one extra bracket on the wiki example. Maybe someone will fix that some day.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strmp(cmdtext, "/remao", true)) // Remove Attached Objects
    {
        for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
        }
        return 1;
    }
    }//remove this one
    return 0;
}
Reply
#3

Quote:
Originally Posted by Youarex
Посмотреть сообщение
There's appears to be one extra bracket on the wiki example. Maybe someone will fix that some day.
Fixed.
https://sampwiki.blast.hk/wiki/RemovePlayerAttachedObject
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)