Raised This Month: $ Target: $400
 0% 

Minor help with orpheu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-14-2010 , 05:38   Minor help with orpheu
Reply With Quote #1

I found this code somewhere a long time ago, I believe Arkshine made it, but it produces an error:

Code:
L 10/14/2010 - 11:33:40: [ORPHEU] Function "Con_Printf" not found
L 10/14/2010 - 11:33:40: [AMXX] Displaying debug trace (plugin "get_stats.amxx")
L 10/14/2010 - 11:33:40: [AMXX] Run time error 10: native error (native "OrpheuGetFunction")
L 10/14/2010 - 11:33:40: [AMXX]    [0] get_stats.sma::catch (line 15)
I have orpheu 2.3a

This is the code:

PHP Code:
#include <amxmodx>
#include <orpheu>

new Msg100 ];

public 
plugin_init()
{
    
register_plugin("Get stats""2.4""Unknown")
    
    
register_clcmd("say /srvstats""catch")
}    

public catch()
{
    new 
OrpheuHook:handlePrintf OrpheuRegisterHookOrpheuGetFunction"Con_Printf" ), "Con_Printf" );
    
    
server_cmd"stats" );
    
server_exec();
    
    
OrpheuUnregisterHookhandlePrintf );
    
    const 
tokensN  7;
    const 
tokenLen 19;
    
    static 
tokenstokensN ][ tokenLen ];
    
    for ( new 
0tokensNi++ )
    {
        
trimMsg );
        
strtokMsgtokens], tokenLenMsgcharsmaxMsg ), ' ' ); 
    }
    
    new 
Float:cpu str_to_floattokens] );
    new 
Float:in  str_to_floattokens] );
    new 
Float:out str_to_floattokens] );
    new 
uptime    str_to_num  tokens] );
    new 
users     str_to_num  tokens] );
    new 
Float:fps str_to_floattokens] );
    new 
players   str_to_num  tokens] );
    
    
server_cmd"say CPU[%f] IN[%f] OUT[%f] UPTIME[%d] USERS[%d] FPS[%f] PLAYERS[%d]"cpuinoutuptimeusersfpsplayers );
}

public 
OrpheuHookReturn:Con_Printf( const a[], const message[] )
{
    
copyMsg,charsmaxMsg ), message );
    return 
OrpheuSupercede;

I know nothing about orpheu ^^
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
 



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 10:19.


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