Raised This Month: $ Target: $400
 0% 

[REQ] server fps plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lol37
Member
Join Date: Apr 2008
Old 11-26-2010 , 06:51   [REQ] server fps plugin
Reply With Quote #1

hi all,
is that possible to make a plugin that show a HUD "Server fps : FPS" ?
FPS should be accurately determinated, the plugin optimized ( not use much cpu ) and i can control refresh rate
thanks for help.
lol37.
lol37 is offline
Old 11-26-2010, 15:44
Exolent[jNr]
This message has been deleted by Exolent[jNr].
FragOwn
Senior Member
Join Date: Jun 2010
Old 11-27-2010 , 08:39   Re: [REQ] server fps plugin
Reply With Quote #2

I found this:
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;
    }

__________________
We can't aim, but we can kill.
FragOwn is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-27-2010 , 15:30   Re: [REQ] server fps plugin
Reply With Quote #3

Code:
#include < amxmodx > #include < orpheu > // RGB colors for the HUD message #define HUD_RED     0 #define HUD_GREEN   255 #define HUD_BLUE    0 // position of the HUD message (0.0 -> 1.0, use -1.0 for center) #define HUD_POS_X   -1.0 #define HUD_POS_Y   -1.0 // refresh rate time (in seconds) #define HUD_TIME    1.0 new g_szStatsResult[ 100 ]; public plugin_init( ) {     register_plugin( "Server FPS Display", "0.0.1", "Exolent/Arkshine" );         set_task( HUD_TIME, "TaskShowFPS", .flags = "b" ); } public TaskShowFPS( ) {     new OrpheuHook:hHandlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" );         server_cmd( "stats" );     server_exec( );         OrpheuUnregisterHook( hHandlePrintf );         new szFPS[ 16 ];         for( new i = 0; i <= 5; i++ )     {         trim( g_szStatsResult );         strtok( g_szStatsResult, szFPS, charsmax( szFPS ), g_szStatsResult, charsmax( g_szStatsResult ), ' ' );     }         set_hudmessage( HUD_RED, HUD_GREEN, HUD_BLUE, HUD_POS_X, HUD_POS_Y, .holdtime = HUD_TIME, .channel = -1 );     show_hudmessage( 0, "Server FPS: %s", szFPS ); } public OrpheuHookReturn:Con_Printf( const a[ ], const szMessage[ ] ) {     copy( g_szStatsResult, charsmax( g_szStatsResult ), szMessage );         return OrpheuSupercede; }

You need to install Orpheu.
Then, copy the contents below and save it in a file called ConPrintf (no extension) and place it in addons/amxmodx/configs/orpheu/functions.
Code:
{
    "name" : "Con_Printf",
    "library" : "engine",
    "arguments" :
    [
        {
            "type" : "char *"
        },
        {
            "type" : "char *"
        }
    ],
    "identifiers" :
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,0xEC,0xB8,0x00,0x10,0x00,0x00,0xE8,"*","*","*","*",0x8B,0x4D,"*",0x8D,0x45,0x0C,"*",0x51,0x8D,0x95,"*","*","*","*",0x68,0x00,0x10,0x00,0x00]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "Con_Printf"
        }
    ]
}
Credits to Arkshine for original code and signature here:
https://forums.alliedmods.net/showpo...&postcount=295
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
lol37
Member
Join Date: Apr 2008
Old 11-30-2010 , 12:32   Re: [REQ] server fps plugin
Reply With Quote #4

Hi exolent thanks !
i installed Orpheus and compiled / installed the plugin but the hud doesn't appear ( it looks running in amx_plugins and all modules are loaded )

Last edited by lol37; 11-30-2010 at 12:57.
lol37 is offline
Old 12-02-2010, 12:45
lol37
This message has been deleted by YamiKaitou. Reason: bump
ancient1
Senior Member
Join Date: Jul 2004
Location: UK
Old 01-17-2013 , 13:10   Re: [REQ] server fps plugin
Reply With Quote #5

Did Excolents server plugin using Orpheo ever get updated or is it in the aproved plugins?

Since forum search is currently busted, im having to google to search these forums, and this was the only server fps plugin I could find.

Cheers,

Ancient
__________________
ancient1 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-17-2013 , 16:01   Re: [REQ] server fps plugin
Reply With Quote #6

Quote:
Originally Posted by ancient1 View Post
Since forum search is currently busted, im having to google to search these forums,
The search works perfectly fine.
__________________
fysiks is offline
pantheist
Junior Member
Join Date: Dec 2012
Old 04-04-2016 , 17:56   Re: [REQ] server fps plugin
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
Code:
#include < amxmodx > #include < orpheu > // RGB colors for the HUD message #define HUD_RED     0 #define HUD_GREEN   255 #define HUD_BLUE    0 // position of the HUD message (0.0 -> 1.0, use -1.0 for center) #define HUD_POS_X   -1.0 #define HUD_POS_Y   -1.0 // refresh rate time (in seconds) #define HUD_TIME    1.0 new g_szStatsResult[ 100 ]; public plugin_init( ) {     register_plugin( "Server FPS Display", "0.0.1", "Exolent/Arkshine" );         set_task( HUD_TIME, "TaskShowFPS", .flags = "b" ); } public TaskShowFPS( ) {     new OrpheuHook:hHandlePrintf = OrpheuRegisterHook( OrpheuGetFunction( "Con_Printf" ), "Con_Printf" );         server_cmd( "stats" );     server_exec( );         OrpheuUnregisterHook( hHandlePrintf );         new szFPS[ 16 ];         for( new i = 0; i <= 5; i++ )     {         trim( g_szStatsResult );         strtok( g_szStatsResult, szFPS, charsmax( szFPS ), g_szStatsResult, charsmax( g_szStatsResult ), ' ' );     }         set_hudmessage( HUD_RED, HUD_GREEN, HUD_BLUE, HUD_POS_X, HUD_POS_Y, .holdtime = HUD_TIME, .channel = -1 );     show_hudmessage( 0, "Server FPS: %s", szFPS ); } public OrpheuHookReturn:Con_Printf( const a[ ], const szMessage[ ] ) {     copy( g_szStatsResult, charsmax( g_szStatsResult ), szMessage );         return OrpheuSupercede; }

You need to install Orpheu.
Then, copy the contents below and save it in a file called ConPrintf (no extension) and place it in addons/amxmodx/configs/orpheu/functions.
Code:
{
    "name" : "Con_Printf",
    "library" : "engine",
    "arguments" :
    [
        {
            "type" : "char *"
        },
        {
            "type" : "char *"
        }
    ],
    "identifiers" :
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x55,0x8B,0xEC,0xB8,0x00,0x10,0x00,0x00,0xE8,"*","*","*","*",0x8B,0x4D,"*",0x8D,0x45,0x0C,"*",0x51,0x8D,0x95,"*","*","*","*",0x68,0x00,0x10,0x00,0x00]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : "Con_Printf"
        }
    ]
}
Credits to Arkshine for original code and signature here:
https://forums.alliedmods.net/showpo...&postcount=295
I think you meant to say make the file Con_Printf . You missed the underscore.
pantheist is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 04-04-2016 , 22:04   Re: [REQ] server fps plugin
Reply With Quote #8

what happened with net_graph ?

nobody wants to be oldschool anymore =[
sad
__________________

Last edited by Depresie; 04-04-2016 at 22:04.
Depresie is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 04-05-2016 , 00:43   Re: [REQ] server fps plugin
Reply With Quote #9

What a necro bump to this thread. Anyway he wants to know server's fps, and net_graph shows client side fps.
__________________
Spirit_12 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 13:24.


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