SA-MP Forums Archive
Attached Object! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Attached Object! (/showthread.php?tid=457898)



Attached Object! - BodyBoardVEVO - 13.08.2013

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 ?


Re: Attached Object! - Youarex - 14.08.2013

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



Re: Attached Object! - Drebin - 14.08.2013

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