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

Can anyone rearrange this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kkkivi
New Member
Join Date: Mar 2021
Old 04-25-2021 , 15:22   Can anyone rearrange this plugin
Reply With Quote #1

Guys this plugin allows me to make a fps limit on my server. But players (especially non-steam) can easily get over this plugin with typing in console developer 1 and fps_modem.. Can anyone disable this commands on my server? Pls help me thank you
Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
 
#define PLUGIN "[AMXX] - FPS MAX"
#define VERSION "1.0"
#define AUTHOR "Nill_"
 
new Trie:g_tCvars;
 
const g_iFpsMax = x; // Sets The FPS Limit.

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
}

public plugin_cfg()
{
    g_tCvars = TrieCreate();
 
    new szFpsMax[3];
    num_to_str(g_iFpsMax, szFpsMax, charsmax(szFpsMax));
   
    TrieSetString(g_tCvars, "fps_max", szFpsMax);
   
    set_task(0.8, "OnTaskCheckCvars", _, _, _, "b");
}

public plugin_end()
{
	TrieDestroy(g_tCvars);
}

public client_putinserver(id)
{
    if(!is_user_bot(id))
    client_cmd( id, "fps_max %d", g_iFpsMax);
}

public OnTaskCheckCvars()
{
    new szPlayers[ 32 ], iNum;
    get_players(szPlayers, iNum, "c");
 
    static iTempID;
 
    for(new i; i < iNum; i++)
    {
        iTempID = szPlayers[i];
       
        query_client_cvar(iTempID, "fps_max", "OnCvarResult");
    }
}

public OnCvarResult(id, const szCvar[], const szValue[])
{
    new szValueCheck[4], szReason[128];
    TrieGetString( g_tCvars, szCvar, szValueCheck, charsmax(szValueCheck));
   
    new iValue = str_to_num(szValue);
   
    if(equal(szCvar, "fps_max"))
    {    
        if(iValue > g_iFpsMax)
        {
            formatex( szReason, charsmax(szReason), "FPS ABOVE THE ALLOWED LIMIT.");
           
            server_cmd( "kick #%d YOU ARE USING MORE THAN 101 FPS.", get_user_userid(id));
            client_print( id, print_console, szReason);
        }
    }
    return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
kkkivi is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-26-2021 , 00:22   Re: Can anyone rearrange this plugin
Reply With Quote #2

Quote:
Originally Posted by kkkivi View Post
guys this plugin allows me to make a fps limit on my server. But players (especially non-steam) can easily get over this plugin with typing in console developer 1 and fps_modem.. Can anyone disable this commands on my server? Pls help me thank you
Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
 
#define plugin "[amxx] - fps max"
#define version "1.0"
#define author "nill_"
 
new trie:g_tcvars;
 
const g_ifpsmax = x; // sets the fps limit.

Public plugin_init()
{
    register_plugin(plugin, version, author)
}

public plugin_cfg()
{
    g_tcvars = triecreate();
 
    new szfpsmax[3];
    num_to_str(g_ifpsmax, szfpsmax, charsmax(szfpsmax));
   
    triesetstring(g_tcvars, "fps_max", szfpsmax);
   
    set_task(0.8, "ontaskcheckcvars", _, _, _, "b");
}

public plugin_end()
{
	triedestroy(g_tcvars);
}

public client_putinserver(id)
{
    if(!is_user_bot(id))
    client_cmd( id, "fps_max %d", g_ifpsmax);
}

public ontaskcheckcvars()
{
    new szplayers[ 32 ], inum;
    get_players(szplayers, inum, "c");
 
    static itempid;
 
    for(new i; i < inum; i++)
    {
        itempid = szplayers[i];
       
        query_client_cvar(itempid, "fps_max", "oncvarresult");
    }
}

public oncvarresult(id, const szcvar[], const szvalue[])
{
    new szvaluecheck[4], szreason[128];
    triegetstring( g_tcvars, szcvar, szvaluecheck, charsmax(szvaluecheck));
   
    new ivalue = str_to_num(szvalue);
   
    if(equal(szcvar, "fps_max"))
    {    
        if(ivalue > g_ifpsmax)
        {
            formatex( szreason, charsmax(szreason), "fps above the allowed limit.");
           
            server_cmd( "kick #%d you are using more than 101 fps.", get_user_userid(id));
            client_print( id, print_console, szreason);
        }
    }
    return plugin_continue;
}
/* amxx-studio notes - do not modify below here
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/
no steam = no help
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
kkkivi
New Member
Join Date: Mar 2021
Old 04-26-2021 , 12:27   Re: Can anyone rearrange this plugin
Reply With Quote #3

Quote:
Originally Posted by iceeedr View Post
no steam = no help
i want to prevent non steam players doing this. This plugin wont be any benefit to non steams unlike it will unbenefit. So whats wrong?
kkkivi is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 04-26-2021 , 12:31   Re: Can anyone rearrange this plugin
Reply With Quote #4

Wrong is, that you allow non-steam users to join your server.
You want us to help you to restrict something that steamers cannot do. (really? I'm sure you cannot change my fps-settings)
Get them to buy the game and your problem is solved by itself. (or not, I didn't check that.)
And BTW. Changing clients settings is called slow hacking, which is also not supported here.
If you don't like their settings: kick them.
__________________


Last edited by Mordekay; 04-26-2021 at 12:32.
Mordekay is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-26-2021 , 14:13   Re: Can anyone rearrange this plugin
Reply With Quote #5

Quote:
Originally Posted by kkkivi View Post
i want to prevent non steam players doing this. This plugin wont be any benefit to non steams unlike it will unbenefit. So whats wrong?
You clearly did not read the forum rules!
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Reply


Thread Tools
Display Modes

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 11:56.


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