PHP Code:
#include <amxmodx>
#include <orpheu>
new Msg[ 100 ];
public plugin_precache()
{
register_srvcmd( "catch", "catch" );
}
public catch()
{
new OrpheuHook:handlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" );
server_cmd( "stats" );
server_exec();
OrpheuUnregisterHook( handlePrintf );
const tokensN = 7;
const tokenLen = 19;
static tokens[ tokensN ][ tokenLen + 1 ];
for ( new i = 0; i < tokensN; i++ )
{
trim( Msg );
strtok( Msg, tokens[ i ], tokenLen, Msg, charsmax( Msg ), ' ' );
}
new Float:cpu = str_to_float( tokens[ 0 ] );
new Float:in = str_to_float( tokens[ 1 ] );
new Float:out = str_to_float( tokens[ 2 ] );
new uptime = str_to_num ( tokens[ 3 ] );
new users = str_to_num ( tokens[ 4 ] );
new Float:fps = str_to_float( tokens[ 5 ] );
new players = str_to_num ( tokens[ 6 ] );
server_print( "CPU[%f] IN[%f] OUT[%f] UPTIME[%d] USERS[%d] FPS[%f] PLAYERS[%d]", cpu, in, out, uptime, users, fps, players );
}
public OrpheuHookReturn:Con_Printf( const a[], const message[] )
{
copy( Msg,charsmax( Msg ), message );
return OrpheuSupercede;
}
i used this plugin,when i type catch in console,it showed the error message:
PHP Code:
] catch
L 04/12/2011 - 11:29:31: [ORPHEU] Function "Con_Printf" not found
L 04/12/2011 - 11:29:31: [AMXX] Displaying debug trace (plugin "test.amxx")
L 04/12/2011 - 11:29:31: [AMXX] Run time error 10: native error (native "OrpheuGetFunction")
L 04/12/2011 - 11:29:31: [AMXX] [0] test.sma::catch (lin
PS:i have installed the module orpheu and signature 'Con_Printf'.
msg about orpheu when server started:
PHP Code:
Orpheu functions search started.
Parsing functions started.
Parsing file "Con_Printf" started
Argument type "char *" validated
Argument type "char *" validated
Searching for signature "[0x55][0x8b][0xec][0xb8][0x00](...)" ... NOT FOUND
Parsing file "Con_Printf" ended
Parsing functions ended.
Orpheu functions search ended.
Orpheu virtual functions search started.
Parsing virtual functions started.
Parsing virtual functions ended.
Orpheu virtual functions search ended.
Orpheu memory structures search started.
Parsing memory structures started.
Parsing memory structures ended.
Orpheu memory
i can't find where is error, can someone help me,thanks in advance!