Okay I did some modifications and here is what I have now:
Code:
#include <sourcemod>
#include <sdktools>
new Handle:hGameConf;
new Handle:hEventGibbed;
public Plugin:myinfo =
{
name = "",
author = "",
description = "",
version = "",
url = "http://www.sourcemod.net/"
};
public OnPluginStart()
{
hGameConf = LoadGameConfigFile("gibexample.games");
StartPrepSDKCall(SDKCall_Player);
PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, "Event_Gibbed");
hEventGibbed = EndPrepSDKCall();
HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new userclient= GetClientOfUserId(GetEventInt(event, "userid"));
new attackerId = GetEventInt(event, "attacker");
decl String:weapon[64];
GetEventString(event, "weapon", weapon, sizeof(weapon));
new headshotId = GetEventInt(event, "customkill");
new attacker = GetClientOfUserId(attackerId);
decl String:attname[64];
GetClientName(attacker, attname, sizeof(attname));
if(GetEventInt(event, "customkill") == 1)
{
SDKCall(hEventGibbed, userclient);
PrintToConsole(userclient,
"You should have gibbed by \"%s\" (weapon \"%s\") (headshot \"%d\")",
attname,
weapon,
headshotId);
return Plugin_Handled;
}
else
{
PrintToConsole(userclient,
"You were killed by \"%s\" (weapon \"%s\") (headshot \"%d\")",
attname,
weapon,
headshotId);
}
return Plugin_Continue;
}
Code:
"Games"
{
"tf"
{
"Offsets"
{
"Event_Gibbed"
{
"windows" "251"
"linux" "252"
}
}
}
}
You can see that I have some printing statements to help give me feedback on what is going on. When a player gets shot in the head the statement "You should have gibbed by..." is printing, but the actual SDKCall() function that calls virtual function "Event_Gibbed" appears to be doing nothing; no errors or anything. Any ideas?