stock służący do zabrania broni graczowi
stock ham_strip_weapon(id, weapon[])
{
if(!equal(weapon, "weapon_", 7))
return 0;
new wId = get_weaponid(weapon);
if(!wId)
return 0;
new wEnt;
while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname", weapon)) && pev(wEnt, pev_owner) != id) {}
if(!wEnt)
return 0;
if(get_user_weapon(id) == wId)
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<
id - id gracza
weapon - np. "weapon_knife" , "weapon_m4a1" musi być koniecznie z weapon_
Przykład użycia:
ham_strip_weapon(id,"weapon_knife")
zabierze graczowi nóż