I tested with this on CS:S and it worked fine.
PHP Code:
#include <sdktools>
#pragma semicolon 1
#include <cstrike>
#include <dhooks>
Handle hAcceptInput;
public OnPluginStart()
{
RegConsoleCmd("sm_kill", SM_Kill);
hAcceptInput = DHookCreate(36, HookType_Entity, ReturnType_Bool, ThisPointer_CBaseEntity, AcceptInput);
DHookAddParam(hAcceptInput, HookParamType_CharPtr);
DHookAddParam(hAcceptInput, HookParamType_CBaseEntity);
DHookAddParam(hAcceptInput, HookParamType_CBaseEntity);
DHookAddParam(hAcceptInput, HookParamType_Object, 20);
DHookAddParam(hAcceptInput, HookParamType_Int);
}
public Action SM_Kill(client, argc)
{
for (new i = MaxClients; i <= GetMaxEntities(); i++)
{
if (IsValidEdict(i) && IsValidEntity(i))
{
decl String:name[80];
GetEdictClassname(i, name, sizeof(name));
if((strncmp(name, "weapon_", 7, false) == 0 || strncmp(name, "item_", 5, false) == 0) && GetEntPropEnt(i, Prop_Data, "m_hOwnerEntity") == -1)
AcceptEntityInput(i, "Kill");
}
}
}
public MRESReturn AcceptInput(int entity, Handle hReturn, Handle hParams)
{
char command[128];
DHookGetParamString(hParams, 1, command, sizeof(command));
PrintToServer("Entity %i got %s", entity, command);
return MRES_Ignored;
}
public OnEntityCreated(int entity, const char[] classname)
{
if(StrEqual(classname, "weapon_deagle"))
{
DHookEntity(hAcceptInput, false, entity);
}
}
You can try logging the command to see what it crashes on perhaps or getting a crash dump.