|
Member
|
06-19-2015
, 16:32
Re: [Any] Merx - A generic point system (build 34)
|
#44
|
It says it can't find the event.
The plugin code I'm using is here:
Spoiler
Code:
#include <sourcemod>
#include "include/Merx"
public OnPluginStart()
{
HookEvent("entity_killed", OnEntityKilled);
}
public Action:OnEntityKilled(Handle:event, const String:name[], bool:dontBroadcast)
{
new entity = GetEventInt(event, "entindex_killed");
if (entity > 0 && IsValidEdict(entity))
{
decl String:classname[32];
GetEdictClassname(entity, classname, sizeof(classname));
if (strcmp(classname, "npc_grenade_frag") == 0 || (strcmp(classname, "npc_satchel") == 0 || (strcmp(classname, "npc_tripmine") == 0)))
{
return Plugin_Handled;
}
if (strncmp(classname, "npc_", 4, false) == 0)
{
new killer = GetEventInt(event, "entindex_attacker");
if (killer > MaxClients || killer < 1)
{
return Plugin_Handled;
}
new Handle:customEvent = CreateCustomEvent("npc_death");
SetCustomEventString(customEvent, "string_npcname", classname);
SetCustomEventInt(customEvent, "int_attacker", killer);
FireCustomEvent(customEvent);
return Plugin_Handled;
}
}
return Plugin_Handled;
}
and the event file is here:
__________________
DaftMink - Psycho Synergy: Moderator/Plugin Manager
|
|
|
|