![:(](http://192.241.182.11/images/smilies/sad.png)
Edit: could it be done through killtarget->netname?
Created 7 years ago2017-04-13 22:10:46 UTC by
abbadon
class CTriggerKillMonsters : public CBaseEntity(untested)
{
public:
void Spawn();
void EXPORT KillUse( CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value );
};
LINK_ENTITY_TO_CLASS( trigger_killmonsters, CTriggerKillMonsters );
void CTriggerKillMonsters::Spawn()
{
SetUse( &CTriggerKillMonsters::KillUse );
}
void CTriggerKillMonsters::KillUse( CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value )
{
edict_t* pEdict = g_engfuncs.pfnPEntityOfEntIndex( gpGlobals->maxclients + 1 );
CBaseEntity* pEnt;
for( int i = gpGlobals->maxclients + 1; i < gpGlobals->maxEntities; ++i, ++pEdict )
{
pEnt = Instance( pEdict );
if( !pEnt || !pEnt->MyMonsterPointer() )
continue;
UTIL_Remove( pEnt );
}
}
trigger_killall would be a more appropriate name+1 vote