Hi,
Since hooking CBasePlayer::Killed with Ham_Killed makes TFC(Team Fortress Classic) hang/crash under windows, here is an alternative way using Orpheu which works incase someone out there would need it.
JSON file:
PHP Code:
{
"name" : "Killed",
"class" : "CBasePlayer",
"library" : "mod",
"arguments" :
[
{
"type" : "entvars_s *"
},
{
"type" : "entvars_s *"
},
{
"type" : "int"
}
],
"indexes" :
[
{
"os" : "windows",
"mod" : "tfc",
"value" : 14
},
{
"os" : "linux",
"mod" : "tfc",
"value" : 16
}
]
}
Test plugin:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <orpheu>
public plugin_init()
{
new OrpheuFunction:Player_Killed = OrpheuGetFunctionFromClass("player","Killed", "CBasePlayer" )
OrpheuRegisterHook(Player_Killed,"Killed",OrpheuHookPre)
}
public Killed(idvictim,idattacker,shouldgib)
{
new victim[32],attacker[32]
get_user_name(idvictim, victim, 31)
get_user_name(idattacker, attacker, 31)
client_print(0,print_chat,"%s was killed by %s",victim,attacker)
}
Regards,
ORiON.