Raised This Month: $ Target: $400
 0% 

Minor help with orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-14-2010 , 06:13   Re: Minor help with orpheu
Reply With Quote #2

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 ?
__________________
Arkshine is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-14-2010 , 06:28   Re: Minor help with orpheu
Reply With Quote #3

Is what signature uploaded?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-14-2010 , 07:07   Re: Minor help with orpheu
Reply With Quote #4

The signature file provided in the post where you have found this code.
__________________
Arkshine is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-14-2010 , 07:28   Re: Minor help with orpheu
Reply With Quote #5

I found it way back, so I can't remember where I found it.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-14-2010 , 08:04   Re: Minor help with orpheu
Reply With Quote #6

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/
__________________
Arkshine is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-14-2010 , 10:43   Re: Minor help with orpheu
Reply With Quote #7

What are signature's supposed to do btw ??
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-14-2010 , 10:50   Re: Minor help with orpheu
Reply With Quote #8

I have done that, but now the server is crashing totally.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-14-2010 , 10:59   Re: Minor help with orpheu
Reply With Quote #9

Quote:
Originally Posted by abdul-rehman View Post
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.
__________________
Arkshine is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 10-14-2010 , 12:01   Re: Minor help with orpheu
Reply With Quote #10

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?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Reply


Thread Tools
Display Modes

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