So like this?
Code:
#include <sourcemod>
#include <sdktools>
new Handle:hGameConf;
new Handle:hBloodSpray;
public OnPluginStart()
{
hGameConf = LoadGameConfigFile("gib-tf.games.txt");
StartPrepSDKCall(SDKCall_Player);
PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "UTIL_BloodSpray");
PrepSDKCall_AddParameter(SDKType_Vector,SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_Vector,SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_PlainOldData,SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_PlainOldData,SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_PlainOldData,SDKPass_Plain);
hBloodSpray = EndPrepSDKCall();
HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}
public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new Float:origin[3];
new Float:dest[3];
GetClientAbsOrigin(client, origin);
dest[0] = origin[0] + 10.0;
dest[1] = origin[1] + 10.0;
dest[2] = origin[2] + 10.0;
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:atname[64];
GetClientName(attacker, atname, sizeof(atname));
if(GetEventInt(event, "customkill") == 1)
{
SDKCall(hBloodSpray, client, origin, dest, 247, 255, 6);
}
PrintToConsole(client,
"You should have gibbed by \"%s\" (weapon \"%s\") (headshot \"%d\")",
atname,
weapon,
headshotId);
PrintToConsole(attacker,
"You should have gibbed by \"%s\" (weapon \"%s\") (headshot \"%d\")",
atname,
weapon,
headshotId);
return Plugin_Continue;
}
Code:
"Games"
{
"tf"
{
"Signatures"
{
"UTIL_BloodSpray"
{
"library" "server"
"windows" "\x8b\x4c\x24\x0c\x83\xec\x60\x83\xf9\xff\x0f\x84\xa7\x00\x00\x00\x33\xc0\xdb\x44\x24\x70\x89\x44\x24\x34\x89\x44\x24\x44\x66\x89\x44\x24\x48\xd9\x5c\x24\x38\x89\x44\x24\x3c\x89\x44\x24\x40\x89\x44\x24\x4c"
"linux" "_Z15UTIL_BloodSprayRK6VectorS1_iii"
}
}
}
}