SA-MP Forums Archive
Destroy a brassknuckle? - 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: Destroy a brassknuckle? (/showthread.php?tid=581117)



Destroy a brassknuckle? - Lirbo - 10.07.2015

I can't destroy that brassknuckle xD I tried with SetPlayerAmmo but it's not working lol
I don't want to ResetPlayerWeapons because I want to remove only the brassknuckle lol


Re: Destroy a brassknuckle? - Mouiz - 10.07.2015

Quote:
Originally Posted by Lirbo
Посмотреть сообщение
I can't destroy that brassknuckle xD I tried with SetPlayerAmmo but it's not working lol
I don't want to ResetPlayerWeapons because I want to remove only the brassknuckle lol
Put this at the botom of the script:

PHP код:
stock RemovePlayerWeapon(playeridweaponid)
{
    new 
plyWeapons[12];
    new 
plyAmmo[12];
    for(new 
slot 0slot != 12slot++)
    {
        new 
wepammo;
        
GetPlayerWeaponData(playeridslotwepammo);
        if(
wep != weaponid)
        {
            
GetPlayerWeaponData(playeridslotplyWeapons[slot], plyAmmo[slot]);
        }
    }
    
ResetPlayerWeapons(playerid);
    for(new 
slot 0slot != 12slot++)
    {
        
GivePlayerWeapon(playeridplyWeapons[slot], plyAmmo[slot]);
    }

And this in the command:

PHP код:
RemovePlayerWeapon(playerid1); 



Re: Destroy a brassknuckle? - Lirbo - 10.07.2015

Quote:
Originally Posted by Mouiz
Посмотреть сообщение
Put this at the botom of the script:

PHP код:
stock RemovePlayerWeapon(playeridweaponid)
{
    new 
plyWeapons[12];
    new 
plyAmmo[12];
    for(new 
slot 0slot != 12slot++)
    {
        new 
wepammo;
        
GetPlayerWeaponData(playeridslotwepammo);
        if(
wep != weaponid)
        {
            
GetPlayerWeaponData(playeridslotplyWeapons[slot], plyAmmo[slot]);
        }
    }
    
ResetPlayerWeapons(playerid);
    for(new 
slot 0slot != 12slot++)
    {
        
GivePlayerWeapon(playeridplyWeapons[slot], plyAmmo[slot]);
    }

And this in the command:

PHP код:
RemovePlayerWeapon(playerid1); 
Ty mate