Raised This Month: $51 Target: $400
 12% 

get_user_fps


Post New Thread Reply   
 
Thread Tools Display Modes
xakintosh
I run no-steam servers!
Join Date: Feb 2010
Location: Edge of nowhere
Old 02-27-2010 , 06:26   Re: get_user_fps
Reply With Quote #11

Very nice but how to export in hudmessage ? Thanks
__________________
As soon as possible.
xakintosh is offline
Send a message via Yahoo to xakintosh Send a message via Skype™ to xakintosh
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-27-2010 , 06:38   Re: get_user_fps
Reply With Quote #12

This method is not reliable, read whole thread.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 02-27-2010, 06:42
xakintosh
This message has been deleted by xakintosh.
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-27-2010 , 06:43   Re: get_user_fps
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
read whole thread
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 03-27-2010 , 14:18   Re: get_user_fps
Reply With Quote #14

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

new g_fps[33][11];
new 
g_i[33];
new 
g_maxplayers;

public 
plugin_init() {
    
register_plugin("fps""fps""fps")
    
register_srvcmd("players","show_info")
    
    
g_maxplayers get_maxplayers()
}

public 
show_info()
{
    new 
name[32]
    new 
ping,loss

    server_print
("NAME        | FPS    | Ping    | Loss")

    for(new 
i=1;i<=g_maxplayers;i++)
    {
        if(!
is_user_connected(i) || is_user_bot(i))
            continue;
            
        
get_user_ping(i,ping,loss)
        
get_user_name(i,name,31)
        
        
server_print("%s |   %ifps | %iping | %iloss",name,get_user_fps(i),ping,loss)
    }
}

//code from get_fps tutorial
public client_putinserver(id)
    
set_task(0.1"count"id""0"b");

public 
client_disconnect(id)
    
remove_task(id);
    
public 
client_PreThink(id)
    
g_fps[id][10]++;

public 
count(id) {

    if ( 
g_i[id] < )
        
g_i[id]++;
    else
        
g_i[id] = 0;
        
    
g_fps[id][g_i[id]] = g_fps[id][10];
    
g_fps[id][10] = 0;
}

get_user_fps(id
{
    new 
i;
    new 
0;
    
    for ( 
i++ )
        
+= g_fps[id][i];
    
    return 
5;

What Am I doing wrong? it shows that my fps is 33-35... but my real fps 99-100...

Last edited by Empowers; 03-27-2010 at 14:21.
Empowers is offline
Send a message via ICQ to Empowers
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-27-2010 , 15:52   Re: get_user_fps
Reply With Quote #15

Quote:
Originally Posted by ConnorMcLeod View Post
This method is not reliable, read whole thread.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 03-28-2010, 11:43
fezh
This message has been deleted by fezh. Reason: nvm
DaxProxy
Senior Member
Join Date: Sep 2007
Old 07-24-2010 , 12:28   Re: get_user_fps
Reply With Quote #16

Now some people asked that if this is even usable somewhere...well yes it is...
PHP Code:
if(get_user_fpsid ) > 60)
{
 
client_cmd(iddisconnect)

Well maybe because it's unaccurate...i would need to use > 75 instead, so that wrong people wont get disconnected.

Since when you are surfing, you can fly much farther with 200 fps, than with 30...actually the difference is so ridiciolous that if you have computer that wont get your FPS over 59, then you shouldn't surf at all...

With this plugin i can restrict players FPS to 60 (ask them to set fps_max 60 or die), which really, really makes my surf server special and even.
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-24-2010 , 15:47   Re: get_user_fps
Reply With Quote #17

Just use query_client_cvar( ) to get the value of fps_max and block it or kick player.

Appart of that i think is stupid to block the fps to 60... is not funny with that fps. And also, people have 60 fps becouse he don't search in google... how to desactive vertical sync setting in videocard.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
DaxProxy
Senior Member
Join Date: Sep 2007
Old 07-24-2010 , 15:50   Re: get_user_fps
Reply With Quote #18

Quote:
Originally Posted by Alucard^ View Post
Just use query_client_cvar( ) to get the value of fps_max and block it or kick player.

Appart of that i think is stupid to block the fps to 60... is not funny with that fps. And also, people have 60 fps becouse he don't search in google... how to desactive vertical sync setting in videocard.
In Estonia, everyone have vSync deactivated and i mean everyone...and have developer 1 with fps 300...and using aliases which let's them surf on waves without stucking.

But yeah, i forgot about query_client_cvar...
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-24-2010 , 23:46   Re: get_user_fps
Reply With Quote #19

More than 131 fps is ilegal... and if everyone have vsync desactivated is becouse they don't know how to use google :/.

That is the problem of the surf.. people who are new in surf, the first thing that he learn is that the surf is for kill... and that is wrong.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 19:36.


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