I use strip_weapon function
Code:
public strip_weapon(id, weaponid){
if ((weaponid < 1) || (weaponid == 2) || (weaponid > 30) || (wepon_mod_initializated == 1)) return 0;
new wEnt;
while ((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapons_name[weaponid])) && pev(wEnt,pev_owner) != id ) {}
if(!wEnt) return 0;
new c, a
if (get_user_weapon(id, c, a) == weaponid) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt)
if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
ExecuteHamB(Ham_Item_Kill,wEnt);
set_pev(id, pev_weapons, pev(id,pev_weapons) & ~(1<<weaponid));
return 1;
}
This code work normal, but after strip_weapon, the player can't pick up new weapon, untill die. How to correct this problem?