SA-MP Forums Archive
Removing Melee 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Removing Melee Weapon (/showthread.php?tid=135259)



Removing Melee Weapon - misko28 - 19.03.2010

I'm stuck. Here, i made command like /removegun
Код:
GivePlayerWeapon(playerid, wepid, -wepammo);
but when doing it with melee weapon, it has no effect
i know that melee ammo is -1 but please help me removing melee wep's!



Re: Removing Melee Weapon - Deat_Itself - 19.03.2010

i dont know that you mean to remove only gun or all the weapons

https://sampwiki.blast.hk/wiki/ResetPlayerWeapons

try to get a help from this . It may help you


Re: Removing Melee Weapon - Razvann - 19.03.2010

pawn Код:
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]);
  }
}
Try using this stock


Re: Removing Melee Weapon - misko28 - 20.03.2010

Quote:
Originally Posted by _Saif_
i dont know that you mean to remove only gun or all the weapons

https://sampwiki.blast.hk/wiki/ResetPlayerWeapons

try to get a help from this . It may help you
I mean removing only weapon that player is holding. It works for all weapons, except weapons in slot 1(melee) because they have -1 ammo.