Not tested but should work
PHP Code:
#pragma semicolon 1
#include <sdkhooks>
#include <sdktools>
public OnEntityCreated( entity, const String:classname[] )
{
if( StrEqual( classname, "weapon_p90" ) || StrEqual( classname, "weapon_g3sg1" ) || StrEqual( classname, "weapon_scar20" ) )
{
SDKHook( entity, SDKHook_Spawn, Hook_OnEntitySpawn );
}
}
public Action:Hook_OnEntitySpawn( entity )
{
if(IsValidEntity( entity ) )
{
RequestFrame(view_as<RequestFrameCallback>(KillEntity), EntIndexToEntRef(entity));
}
return Plugin_Continue;
}
void KillEntity(int entityReference)
{
AcceptEntityInput(entityReference, "Kill" );
}
__________________