Raised This Month: $ Target: $400
 0% 

[Orpheu] Hook GetStatsString


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-07-2015 , 18:38   [Orpheu] Hook GetStatsString
Reply With Quote #1

I want to show CPU usage via hud, but don't know how to find signatures for void GetStatsString(char *buf, int bufSize). Search in cs.so, but nothing is found.

Last edited by FromTheFuture; 05-07-2015 at 21:20.
FromTheFuture is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-07-2015 , 21:41   Re: [Orpheu] Hook GetStatsString
Reply With Quote #2

This is not work.

Spoiler


Now I did it with parse Printf, but better will be make with GetStatsString.

Last edited by FromTheFuture; 05-07-2015 at 23:18.
FromTheFuture is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-08-2015 , 04:50   Re: [Orpheu] Hook GetStatsString
Reply With Quote #3

What do you mean by doesn't work? Signature is correct.
__________________
Arkshine is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-08-2015 , 14:14   Re: [Orpheu] Hook GetStatsString
Reply With Quote #4

With this server is crashes

PHP Code:
    Func OrpheuGetFunction("GetStatsString");
    
register_clcmd("say /cpu""cpu");

new 
mass[64]
public 
cpu(id)
{
    
OrpheuCall(Funcmass63);
    
client_print(idprint_chatmass);

FromTheFuture is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-09-2015 , 07:16   Re: [Orpheu] Hook GetStatsString
Reply With Quote #5

Im call the function right?
FromTheFuture is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-09-2015 , 08:01   Re: [Orpheu] Hook GetStatsString
Reply With Quote #6

you could use this
PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN_NAME    "CPU Clocker"
#define PLUGIN_AUTHOR    "Carnacior"
#define PLUGIN_VERSION    "1.0"

new 0

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
set_task(1.0"write_fps"350__"b")
}

public 
write_fps()
{
    new 
iPlayers[32]
    new 
iNum
    
new player
    get_players
iPlayersiNum )
    for( new 
0iNumi++ )
    {
        
player iPlayers[i]
        
client_print(player,print_console,"FPS: %d",x)
    }
    
0
}

public 
server_frame()
{
    
x++;

just change the console print and whatever you want
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 05-09-2015 , 09:23   Re: [Orpheu] Hook GetStatsString
Reply With Quote #7

Quote:
Originally Posted by aron9forever View Post
you could use this
PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN_NAME    "CPU Clocker"
#define PLUGIN_AUTHOR    "Carnacior"
#define PLUGIN_VERSION    "1.0"

new 0

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
set_task(1.0"write_fps"350__"b")
}

public 
write_fps()
{
    new 
iPlayers[32]
    new 
iNum
    
new player
    get_players
iPlayersiNum )
    for( new 
0iNumi++ )
    {
        
player iPlayers[i]
        
client_print(player,print_console,"FPS: %d",x)
    }
    
0
}

public 
server_frame()
{
    
x++;

just change the console print and whatever you want
I guess that user is trying to hook CPU usage from server LAWL, not fps.

You can log output from commands in debug.log from HLDS and hook file to display at hudtextmessage, is not more clean than create an entry for Orpheu ?

Sorry for my repply, if is not exactly that you want.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 05-09-2015 , 17:31   Re: [Orpheu] Hook GetStatsString
Reply With Quote #8

Cant this be done by a module ? Its a good idea to get CPU first you have to know how its based ( count ). . I dont really know much but its seems a nice idea . Can you give me this event in c++ ...
Freezo Begin is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-09-2015 , 20:56   Re: [Orpheu] Hook GetStatsString
Reply With Quote #9

Quote:
Originally Posted by ^SmileY View Post
I guess that user is trying to hook CPU usage from server LAWL, not fps.

You can log output from commands in debug.log from HLDS and hook file to display at hudtextmessage, is not more clean than create an entry for Orpheu ?

Sorry for my repply, if is not exactly that you want.
I'm sorry, I was hammered as shit when I wrote this
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 05-10-2015 , 01:32   Re: [Orpheu] Hook GetStatsString
Reply With Quote #10

Quote:
Originally Posted by Freezo Begin View Post
Cant this be done by a module ? Its a good idea to get CPU first you have to know how its based ( count ). . I dont really know much but its seems a nice idea . Can you give me this event in c++ ...
I've done this with ConPrintf Hook, then add three natives
PHP Code:
native get_server_cpu();
native get_server_uptime();
native get_server_fps(); 
Spoiler
FromTheFuture is offline
Reply



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 20:57.


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