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(playerid, weaponid)
{
new plyWeapons[12];
new plyAmmo[12];
for(new slot = 0; slot != 12; slot++)
{
new wep, ammo;
GetPlayerWeaponData(playerid, slot, wep, ammo);
if(wep != weaponid)
{
GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
}
}
ResetPlayerWeapons(playerid);
for(new slot = 0; slot != 12; slot++)
{
GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
}
}
And this in the command:
PHP код:
RemovePlayerWeapon(playerid, 1);
Re: Destroy a brassknuckle? -
Lirbo - 10.07.2015
Quote:
Originally Posted by Mouiz
Put this at the botom of the script:
PHP код:
stock RemovePlayerWeapon(playerid, weaponid)
{
new plyWeapons[12];
new plyAmmo[12];
for(new slot = 0; slot != 12; slot++)
{
new wep, ammo;
GetPlayerWeaponData(playerid, slot, wep, ammo);
if(wep != weaponid)
{
GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
}
}
ResetPlayerWeapons(playerid);
for(new slot = 0; slot != 12; slot++)
{
GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
}
}
And this in the command:
PHP код:
RemovePlayerWeapon(playerid, 1);
|
Ty mate