I'm trying to write a simple plugin for my own server that removes guns on death. I found this in twisted's death match. Does this do that?
Code:
public pfn_touch(ptr, ptd)
{
if(tdmstate && is_valid_ent(ptr))
{
new classname[32]
if(is_valid_ent(ptr))
entity_get_string(ptr,EV_SZ_classname,classname,31)
if(equali(classname,"weaponbox"))
{
for(new inum=0;inum<=get_global_int(GL_maxEntities);inum++)
{
if(!is_valid_ent(inum)) continue
new class[51]
entity_get_string(inum,EV_SZ_classname,class,50)
if(containi(class,"weapon_") == -1) continue
new owner = entity_get_edict(inum,EV_ENT_owner)
if(ptr == owner)
remove_entity(inum)
}
remove_entity(ptr)
}
else if(containi(classname,"weapon_") != -1)
remove_entity(ptr)
}
return PLUGIN_CONTINUE
}
If someone knows of a plugin that just removes guns from the map when someone dies, or a simple code to do that--that's all I want.
Thanx.