Raised This Month: $ Target: $400
 0% 

FPS Check


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-25-2015 , 00:29   FPS Check
Reply With Quote #1

Not that good with the scripting, but why doesn't this work? It is a basic code.

PHP Code:
public client_putinserver(id)
{
    if (!
is_user_bot(id))
        
query_client_cvar(id"fps_max""cvar_result_func");
}

public 
cvar_result_func(id, const cvar[], const value[])
{
    new 
fps str_to_num(value)
    new 
maxlimit 125
    
new name[32]
    
get_user_name(idname31)
       
    
log_amx("(%s)'s fps_max value = ^"%s^""namevalue);
    
    if (
fps maxlimit){
        
client_print(0print_chat"Warning %s is using fps over 125. Please lower the value."name);
    }
    return 
PLUGIN_HANDLED

Spirit_12 is offline
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 01-27-2015 , 20:09   Re: FPS Check
Reply With Quote #2

try to set a task for 1.5 sec in putinserver. in task's public u check him by querry.

as far as i know.. that function was not working any more..
__________________

My PC Themes . .
red_bull2oo6 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-28-2015 , 09:04   Re: FPS Check
Reply With Quote #3

not sure, but try it
Code:
public client_putinserver(id)
{
    if (!is_user_bot(id))
        //query_client_cvar(id, "fps_max", "cvar_result_func");
        set_task(1.0, "cvar_result_func", id, _, _,"b") // in public cvar_result_func try to add if (is_user_connected
}

Last edited by Fuck For Fun; 01-28-2015 at 09:04.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-30-2015 , 08:28   Re: FPS Check
Reply With Quote #4

well query_client_cvar should be the best way .

But you can try something like this if you wan't just checking the fps ...

Code:
new fps[33] new Float: systime[33] public client_PreThink(id){         new Float: gametime = get_gametime()         fps[id] = floatround(1.0 / (gametime - systime[id]));         systime[id] = gametime; }

adding statement for fps[id] ...

Last edited by Freezo Begin; 01-30-2015 at 08:28.
Freezo Begin is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-30-2015 , 09:09   Re: FPS Check
Reply With Quote #5

Quote:
Originally Posted by Fuck For Fun View Post
not sure, but try it
Code:
public client_putinserver(id)
{
    if (!is_user_bot(id))
        //query_client_cvar(id, "fps_max", "cvar_result_func");
        set_task(1.0, "cvar_result_func", id, _, _,"b") // in public cvar_result_func try to add if (is_user_connected
}
Lol, that will not even query the fps

if (fps > maxlimit)

if (str_to_float(fps) > maxlimit)
__________________
Jhob94 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-30-2015 , 13:16   Re: FPS Check
Reply With Quote #6

I did some experiments on my own and found something weird.

PHP Code:
public client_putinserver(id)
{
    if (!
is_user_bot(id))
        
query_client_cvar(id"fps_max""cvar_result_func");

Above code doesn't work, but this does.

PHP Code:
public client_connect(id)
{
    if (!
is_user_bot(id))
        
query_client_cvar(id"fps_max""cvar_result_func");

I don't really see the reason, but if I use client_connect then plugins works fine. My problem is that after the map change some players have been getting kicks, when there is nothing in the code related to kick.

Personally, I was able to connect just fine, even after the map change. Guess I need to do some more research into this matter.

Thanks for everyone who tried to help. Appreciated !!
Spirit_12 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-30-2015 , 15:48   Re: FPS Check
Reply With Quote #7

Quote:
Originally Posted by Jhob94 View Post
Lol, that will not even query the fps

if (fps > maxlimit)

if (str_to_float(fps) > maxlimit)
lol ^^ my mistake.


@Spirit_12

u want check fps with warning or just block that no one can over 125 fps?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-30-2015 , 18:52   Re: FPS Check
Reply With Quote #8

I just want to stop people from using fps exploit to gain extra speed. It also removed the slow down after the jump in a multijump server, which I got. If there is a legit way to hard code an upper limit for fps, then that would solve majority of my problems.
Spirit_12 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-31-2015 , 07:27   Re: FPS Check
Reply With Quote #9

Try This, My Edit:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >

#define PLUGIN "Anti FPS"
#define VERSION "1.0"
#define AUTHOR "author"

#define FPS_VALUE 125 // default is 101 fps

new WrongValues[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id
{
    if(
is_user_bot(id) || is_user_hltv(id)) return;
    {
        
set_task(1.5"client_checkfps"id__,"b")
        
WrongValues[id] = 0
    
}
}
public 
client_disconnect(id
{
    if (
task_exists(id)) 
    {
        
remove_task(id)
    }
}

public 
client_checkfps(id
{
    if (
is_user_connected(id)) 
    {
        
query_client_cvar(id"fps_max""cvar_result_func")
    }
    else {
        
remove_task(id)
    }
}

public 
cvar_result_func(id, const cvar[], const value[]) 
{
    new 
Float:valuenum floatstr(value)
    new 
playername[32
    
get_user_nameidplayernamecharsmaxplayername ) );
    if (
valuenum FPS_VALUE) {
        if (
equal(cvar,"fps_max")) {
            
client_cmd(id"fps_max 125")
        }
        
/*if (WrongValues[id] > 2) remove /* to enable kick player over +125 fps
        {
            new player = get_user_userid(id)
            server_cmd("kick #%d", player)
            client_print(0, print_chat, "%s kicked for having fps over 125!", playername[0])
        }*/
        
if (WrongValues[id] < 3) {
            
client_print(0print_chat"Warning %s is using fps over 125."playername[0])
            
log_amx("(%s) had over fps 125!"playername[0])
            
WrongValues[id] = WrongValues[id] + 1
        
}
    }


Last edited by Fuck For Fun; 01-31-2015 at 07:28.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-31-2015 , 09:00   Re: FPS Check
Reply With Quote #10

there is a Basehook engine or what ever , and there is a command that change the real Cvar to fake one something like this :

Enginecs.Cvar("fps_max","fake_fps")
idk something like this .
Freezo Begin is offline
Old 01-11-2016, 19:18
msmajda9
This message has been deleted by msmajda9. Reason: new update
Old 01-11-2016, 19:21
msmajda9
This message has been deleted by msmajda9. Reason: new update
Old 01-11-2016, 19:27
msmajda9
This message has been deleted by msmajda9.
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 06:46.


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