View Single Post
dstopgunner
Senior Member
Join Date: Oct 2007
Old 06-05-2008 , 07:49   Re: ham_give_weapon and ham_strip_weapon
Reply With Quote #29

To everybody Out There ! How do I use this code? In the plugin or use it as another include?
Im trying to strip everybody's knife at round start how do i do that?

I tried to write a plugin myself it doesnt work

PHP Code:
 
public plugin_init() {
register_plugin(Knife round start remover1.0DS_ToP_GunNeR
register_event("HLTV""event_new_round""a""1=0""2=0")
}
 
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) == wIdExecuteHamB(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;
}
 
public 
event_new_round(id) { 
if(
user_has_weapon(idCSW_KNIFE))
{
ham_strip_weapon(id"weapon_knife"); 
}

And weridly when I post php it doesnt leave a gap ..
dstopgunner is offline