Raised This Month: $51 Target: $400
 12% 

Ham_Killed & TFC


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
teh ORiON
Member
Join Date: Sep 2011
Location: Denmark
Old 08-17-2012 , 09:28   Ham_Killed & TFC
Reply With Quote #1

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(idvictimvictim31)     
    
get_user_name(idattackerattacker31
    
    
client_print(0,print_chat,"%s was killed by %s",victim,attacker)

Regards,
ORiON.
teh ORiON is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode