Help| about this object - fire arms
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/attach", true, 7) == 0)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, 1) {
        RemovePlayerAttachedObject(playerid, 1); }
        if(IsPlayerAttachedObjectSlotUsed(playerid, 0) {
        RemovePlayerAttachedObject(playerid, 0); }
        SetPlayerAttachedObject(playerid, 0, 19270, 5);
        SetPlayerAttachedObject(playerid, 1, 19270, 5);
        return 1;
    }

    if(strcmp(cmdtext, "/remove", true, 7) == 0)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, 1) {
        RemovePlayerAttachedObject(playerid 1); }
        if(IsPlayerAttachedObjectSlotUsed(playerid, 0) {
        RemovePlayerAttachedObject(playerid, 0); }
        return 1;
    }
    return 1;
}
EDIT: Edited the post to support /attach and /remove commands.
Reply


Messages In This Thread
Help| about this object - fire arms - by LOLtz120 - 11.07.2012, 16:05
Re: Help| about this object - fire arms - by Andregood - 11.07.2012, 16:14
Re: Help| about this object - fire arms - by LOLtz120 - 11.07.2012, 16:20
Re: Help| about this object - fire arms - by Andregood - 11.07.2012, 16:24
Re: Help| about this object - fire arms - by clarencecuzz - 11.07.2012, 16:24
Re: Help| about this object - fire arms - by LOLtz120 - 11.07.2012, 16:29
Re: Help| about this object - fire arms - by Andregood - 11.07.2012, 16:42
Re: Help| about this object - fire arms - by LOLtz120 - 11.07.2012, 16:58
Re: Help| about this object - fire arms - by clarencecuzz - 11.07.2012, 17:07

Forum Jump:


Users browsing this thread: 1 Guest(s)