#include <sourcemod>
#pragma semicolon 1
public OnPluginStart()
{
HookEvent("player_death", Event_OnPlayerDeath_Pre, EventHookMode_Pre);
HookEvent("player_death", Event_OnPlayerDeath_Post);
HookEvent("player_death", Event_OnPlayerDeath_PostNoCopy, EventHookMode_PostNoCopy);
}
public Event_OnPlayerDeath_Pre(Handle:hEvent, const String:name[], bool:dontBroadcast)
{
decl String:sWeapon[64];
sWeapon[0] = '\0';
GetEventString(hEvent, "weapon", sWeapon, sizeof(sWeapon));
LogAction(-1, -1, "Event_OnPlayerDeath_Pre:\n\
userid - %i\n\
victim_ndex - %i\n\
attacker - %i\n\
victim_index - %i\n\
weapon - %s\n\
headshot - %b\n\
dominated - %i\n\
revenge - %i\n",
GetEventInt(hEvent, "userid"),
GetClientOfUserId(GetEventInt(hEvent, "userid")),
GetEventInt(hEvent, "attacker"),
GetClientOfUserId(GetEventInt(hEvent, "attacker")),
sWeapon,
GetEventBool(hEvent, "headshot"),
GetEventInt(hEvent, "dominated"),
GetEventInt(hEvent, "revenge"));
}
public Event_OnPlayerDeath_Post(Handle:hEvent, const String:name[], bool:dontBroadcast)
{
decl String:sWeapon[64];
sWeapon[0] = '\0';
GetEventString(hEvent, "weapon", sWeapon, sizeof(sWeapon));
LogAction(-1, -1, "Event_OnPlayerDeath_Post:\n\
userid - %i\n\
victim_ndex - %i\n\
attacker - %i\n\
victim_index - %i\n\
weapon - %s\n\
headshot - %b\n\
dominated - %i\n\
revenge - %i\n",
GetEventInt(hEvent, "userid"),
GetClientOfUserId(GetEventInt(hEvent, "userid")),
GetEventInt(hEvent, "attacker"),
GetClientOfUserId(GetEventInt(hEvent, "attacker")),
sWeapon,
GetEventBool(hEvent, "headshot"),
GetEventInt(hEvent, "dominated"),
GetEventInt(hEvent, "revenge"));
}
public Event_OnPlayerDeath_PostNoCopy(Handle:hEvent, const String:name[], bool:dontBroadcast)
{
decl String:sWeapon[64];
sWeapon[0] = '\0';
GetEventString(hEvent, "weapon", sWeapon, sizeof(sWeapon));
LogAction(-1, -1, "Event_OnPlayerDeath_PostNoCopy:\n\
userid - %i\n\
victim_ndex - %i\n\
attacker - %i\n\
victim_index - %i\n\
weapon - %s\n\
headshot - %b\n\
dominated - %i\n\
revenge - %i\n",
GetEventInt(hEvent, "userid"),
GetClientOfUserId(GetEventInt(hEvent, "userid")),
GetEventInt(hEvent, "attacker"),
GetClientOfUserId(GetEventInt(hEvent, "attacker")),
sWeapon,
GetEventBool(hEvent, "headshot"),
GetEventInt(hEvent, "dominated"),
GetEventInt(hEvent, "revenge"));
}