AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Minor help with orpheu (https://forums.alliedmods.net/showthread.php?t=140571)

Jelle 10-14-2010 05:38

Minor help with orpheu
 
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 ^^

Arkshine 10-14-2010 06:13

Re: Minor help with orpheu
 
The code is made by Joaquim, I've just modified a bit to get it working for Orpheu 2.x.

Is the file signature well uploaded in your server ?

Jelle 10-14-2010 06:28

Re: Minor help with orpheu
 
Is what signature uploaded?

Arkshine 10-14-2010 07:07

Re: Minor help with orpheu
 
The signature file provided in the post where you have found this code.

Jelle 10-14-2010 07:28

Re: Minor help with orpheu
 
I found it way back, so I can't remember where I found it.

Arkshine 10-14-2010 08:04

Re: Minor help with orpheu
 
http://forums.alliedmods.net/showthr...tf#post1126226

Copy-paste the signature content in a file named exactly "Con_Printf" then move the file in orpheu/functions/

abdul-rehman 10-14-2010 10:43

Re: Minor help with orpheu
 
What are signature's supposed to do btw ??

Jelle 10-14-2010 10:50

Re: Minor help with orpheu
 
I have done that, but now the server is crashing totally.

Arkshine 10-14-2010 10:59

Re: Minor help with orpheu
 
Quote:

Originally Posted by abdul-rehman (Post 1324573)
What are signature's supposed to do btw ??

To locate functions into the memory.

Quote:

I have done that, but now the server is crashing totally.
Crash when ? Just tried again, and it works without problem.

Jelle 10-14-2010 12:01

Re: Minor help with orpheu
 
It crashes my server when I write /srvstats I get "Program is not responding" in windows.

It can't be because I have 2 CPU cores can it? I set it to only run on core 1. As it checks CPU activity too, can it be the issue?


All times are GMT -4. The time now is 10:19.

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