View Single Post
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-11-2010 , 18:28   Re: Orpheu: Using virtual functions
Reply With Quote #14

hehehe well this module gives us ALOT of options, so why not give it a try ;)

And yes it works fine now after placeing the args. right. Thanks! ->

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <Orpheu>
#include <fakemeta>

/*
Offset WIN32 = 20

CBasePlayer::Killed(entvars_s *, int)
*/

public plugin_init() 
{
    new 
OrpheuFunction:Player_Killed OrpheuGetFunctionFromClass("player","Killed""CBasePlayer" )
    
OrpheuRegisterHook(Player_Killed,"Killed")
}
public 
Killed(victimkillersomething)
{
    new 
victim1[32]
    
get_user_name(victimvictim131)
    
    new 
killer1[32]
    
get_user_name(killerkiller131)
    
    new 
isomething[32]
    
pev(somethingpev_classnameisomething31)
    
    
    
client_print(03"%s killed %s with %s"killer1victim1isomething)
    
// FYI isomething printet player...
}
/*

Killed file :
/////////////////////////////////////////////////////////////////////////
{
    "name"      : "Killed",
    "class"     : "CBasePlayer",
    "library"   : "mod",
    "arguments" : 
    [
        {
            "type" : "entvars_s *"
        },
        {
            "type" : "int"
        }
    ],
    "indexes" : 
    [
        {
            "os"    : "windows",
            "mod"   : "dod",
            "value" : 20
        },
        {
            "os"    : "linux",
            "mod"   : "dod",
            "value" : 22
        }
    ]
}
//////////////////////////////////////////////////////////////////////////
Path to Killed is:
\dod\addons\amxmodx\configs\orpheu\virtualFunctions\CBasePlayer

*/ 

One more, what if the function returns void -> CBasePlayer::Spawn(void) e.g.

It doesnt like void ->

Code:
    "arguments" : 
    [
        {
            "type" : "void"
        }
    ],
__________________
Dr.G is offline