Removing Melee Weapon
#1

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!
Reply
#2

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
Reply
#3

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
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)