how do i strip the current wpn of a player? Ive tryed this but it didnt do anything:
PHP Code:
new clip, ammo, wpn = get_user_weapon(id, clip, ammo)
new ent_class[32]
get_weaponname(wpn, ent_class, sizeof ent_class - 1)
ham_strip_weapon(id, ent_class)
PHP Code:
// By XxAvalanchexX
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<<wId));
return 1;
}
Its cuz iam makein a throwing knifes mod for DoD, and in DoD there are 3 diffent knifes with 3 diffent classnames...
__________________