 |
|
Veteran Member
Join Date: Apr 2017
Location: Brazil
|

04-26-2021
, 00:22
Re: Can anyone rearrange this plugin
|
#2
|
Quote:
Originally Posted by kkkivi
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
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/
|
|
|
|