Remove Player Weapon - 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 Player Weapon (
/showthread.php?tid=439526)
Remove Player Weapon -
Tanush123 - 25.05.2013
What's the function to remove the weapon they're holding.
Re: Remove Player Weapon -
TheStreetsRP - 25.05.2013
You can't remove a single weapon. What you'll need to do is find out all of the player's current weapons using
GetPlayerWeaponData add the weapons he has into an array.
Then use GetPlayerWeapon to compare the list of weapons in the array you just created.. Remove that specific weapon, then loop through the array and
GivePlayerWeapon all of the weapons in the array..
Re: Remove Player Weapon -
jordy.kiesebrink - 25.05.2013
You can remove all the weapons from a player with:
pawn Код:
ResetPlayerWeapons(playerid);
Re: Remove Player Weapon -
Bharel - 25.05.2013
Why are you guys complicating stuff so much...
Put this code somewhere on top
Код:
stock RemovePlayerWeapon(playerid, weaponid)
{
SetPlayerArmedWeapon(playerid, weaponid);
if (GetPlayerWeapon(playerid) != 0) GivePlayerWeapon(playerid, -(GetPlayerAmmo(playerid)));
return 1;
}
Use
RemovePlayerWeapon(playerid, weaponid);
Rep if it helped ^^
Re: Remove Player Weapon -
Tanush123 - 25.05.2013
Thanks