SA-MP Forums Archive
Remove items not working - 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: Remove items not working (/showthread.php?tid=357597)



Remove items not working - Squirrel - 07.07.2012

Well okay I got this command to set up my items. /equip works perfectly but the /removeitems doesnt. It keeps saying that I am already un-equiped

PHP код:
if (GetPlayerTeam(playerid) == POLICE) return SendClientMessage(playerid, COLOR_RED, "<!>You must be police officer in order to use this!");
    {
        if(
strcmp(cmdtext, "/equip", true, 0) == 0)
        {
            if(
GetPVarInt(playerid, "Equipped") != 0) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You are already equipped!");
            if(
GetPlayerSkin(playerid) < 280 || GetPlayerSkin(playerid) > 288) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "This command is available only to the servants of the law.");
            
SetPlayerAttachedObject(playerid, 1, 19142,  1, 0.1,  0.05, 0.0,  0.0,   0.0,   0.0);
            
SetPlayerAttachedObject(playerid, 2, 19141,  2, 0.11, 0.0,  0.0,  0.0,   0.0,   0.0);
            
SetPlayerAttachedObject(playerid, 3, 18637, 13, 0.35, 0.0,  0.0,  0.0,   0.0, 180.0);
            
SetPlayerAttachedObject(playerid, 4, 18642,  7, 0.1,  0.0, -0.11, 0.0, -90.0,  90.0);
            
GivePlayerWeapon(playerid, 3, 1);
            
SetPlayerArmour(playerid, 100.0);
            
SetPVarInt(playerid, "Equipped", 1);
            
SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You outfits.");
            return 
1;
        }
        if(
strcmp(cmdtext, "/removeitems", true, 0) == 0)
        {
            if(
GetPVarInt(playerid, "Equipped") != 1) return SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You already unequipped!");
            new 
Float:ap;
            
GetPlayerArmour(playerid, ap);
            if(
ap > 0)
            {
                
RemovePlayerAttachedObject(playerid, 1);
                
SetPlayerArmour(playerid, 0.0);
            }
            
RemovePlayerAttachedObject(playerid, 2);
            
RemovePlayerAttachedObject(playerid, 3);
            
RemovePlayerAttachedObject(playerid, 4);
            new 
weapons[13][2];
            for (new 
i; i < 13; i++)
            {
                
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
            }
            
ResetPlayerWeapons(playerid);
            for (new 
i; i < 13; i++)
            {
                if(
i == 1) continue;
                
GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
            }
            
SetPVarInt(playerid, "Equipped", 0);
            
SendClientMessage(playerid, COLOR_INTERFACE_BODY, "You undressed and disarmed.");
            return 
1;
        }
    } 



Re: Remove items not working - Squirrel - 07.07.2012

Resolved.