Raised This Month: $ Target: $400
 0% 

how to get CPU Stat?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lucky109
Senior Member
Join Date: Jan 2005
Old 02-11-2008 , 21:36   how to get CPU Stat?
Reply With Quote #1

as title....
iCPU Loading..like : 75% Loading

Code:
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	set_task(5.0, "Stats", 0,"",0, "b")
}
public Stats()
{
	new Stat = get_cvar_string("stats")
	set_hudmessage(0, 255, 0, 0.02.0, 0.66, 0, 6.0, 12.0)
	show_hudmessage(id, "%s", Stat)

	
}
this will mostly not work cuz the command stats print's 2 lines ...
lucky109 is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 02-12-2008 , 09:47   Re: how to get CPU Stat?
Reply With Quote #2

rcon stats
zwfgdlc is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-12-2008 , 09:49   Re: how to get CPU Stat?
Reply With Quote #3

Not possible I believe. stats is a command, not a cvar.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 02-12-2008 , 13:59   Re: how to get CPU Stat?
Reply With Quote #4

so how to print it in realtime(every fps)?
__________________
Voi is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 02-12-2008 , 14:45   Re: how to get CPU Stat?
Reply With Quote #5

Quote:
Originally Posted by Voi View Post
so how to print it in realtime(every fps)?
Server fps ?!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 02-12-2008 , 16:57   Re: how to get CPU Stat?
Reply With Quote #6

yes
__________________
Voi is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 02-12-2008 , 22:20   Re: how to get CPU Stat?
Reply With Quote #7

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

#define PLUGIN "Server Frames"
#define VERSION "1.0"
#define AUTHOR "Alka"

new bool:ShowFramesStatus[33];

public 
plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_forward(FM_StartFrame"Fwd_StartFrame");
    
    
register_clcmd("say /showfps""CmdShowFps");
    
register_clcmd("say /fps""CmdShowFps");
}

public 
CmdShowFps(id)
{
    if(!
ShowFramesStatus[id])
    {
        
ShowFramesStatus[id] = true;
        
client_print(idprint_chat"From now, you will see server frames/sec.");
    }
    else
    {
        
ShowFramesStatus[id] = false;
        
client_print(idprint_chat"You will no longer see server frames/sec.");
    }
}

public 
client_disconnect(id)
    
ShowFramesStatus[id] = false;

public 
Fwd_StartFrame()
{
    static 
Float:GameTimeFloat:FramesPer 0.0;
    static 
Float:Fps;
    
    
GameTime get_gametime();
    
    if(
FramesPer >= GameTime)
        
Fps += 1.0;
    else
    {
        
FramesPer FramesPer 1.0//Frames per 1 sec.
        
        
static Players[32], Num;
        
get_players(PlayersNum);
        
        for(new 
Num i++)
        {
            if(!
ShowFramesStatus[Players[i]])
                continue;
            
            
set_hudmessage(25500, -1.00.901.01.00.10.1, -1);
            
show_hudmessage(Players[i], "Server Frames/Sec : %.1f"Fps);
        }
        
Fps 0.0;
    }

:S
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 02-13-2008 , 03:07   Re: how to get CPU Stat?
Reply With Quote #8

:O
__________________
Still...lovin' . Connor noob! Hello
Alka 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 02:46.


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