PHP Code:
RegisterHam(Ham_Spawn, "weaponbox", "weapon_ground", 1)
public weapon_ground(iEnt)
{
new szName[32]
entity_get_string(iEnt, EV_SZ_classname, szName, charsmax(szName))
if(equal(szName, "grenade"))
return HAM_IGNORED
set_pev(iEnt, pev_flags, FL_KILLME)
dllfunc(DLLFunc_Think, iEnt)
return HAM_IGNORED
}
I'm using this to disallow weapon dropping, i.e. having weapons on the ground, but I wan't to allow only the C4 to be able to "spawn". I tried getting classname and modelname and check if it's equal to "grenade" or "weapon_c4", but it doesn't work.