Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #include <colorchat>
- new bool:sBuild_new[33];
- new WarFps[33],UserFPS[33], CheckFPS,MaxFps,CheckCVAR,Netgraph;
- new g_CheckCvar[][] =
- {
- "gl_vsync","fps_max","fps_modem","fps_override","cl_sidespeed",
- "cl_forwardspeed","cl_backspeed","cl_yawspeed","developer","cl_filterstuffcmd",
- "m_pitch","m_yaw","cl_bob","cl_bobcycle","cl_bobup","cl_lw","cl_lc","net_graph"
- };
- public plugin_init()
- {
- register_plugin("Anti-Cheat (Cvar | FPS)","2.5","Seroff");
- CheckFPS=register_cvar("Check_Fps","1");
- CheckCVAR=register_cvar("Check_Cvars", "1");
- Netgraph=register_cvar("write_net_graph", "3");
- MaxFps=register_cvar("Max_Fps", "111");
- register_forward(FM_CmdStart, "Player_CmdStart");
- register_forward(FM_PlayerPostThink, "Player_PostThink");
- }
- public client_putinserver(id)
- {
- if(get_pcvar_num(CheckCVAR)==1){
- console_cmd(id,"cl_sidespeed 400;cl_forwardspeed 400;cl_backspeed 400;cl_yawspeed 210;m_pitch 0.022;m_yaw 0.022;cl_bob 0.01;cl_bobcycle 0.8;cl_bobup 0.5;cl_lw 1;cl_lc 1;cl_pitchspeed 225");
- set_task(5.0, "Check_Cvar",id,_,_,"b");
- }
- }
- public Player_CmdStart(id, uc_handle)
- {
- if(is_user_alive(id) && get_pcvar_num(CheckFPS)==1){
- UserFPS[id] = floatround(1/(get_uc(uc_handle, UC_Msec) * 0.001));
- }
- return FMRES_IGNORED;
- }
- public Player_PostThink(id)
- {
- if(is_user_alive(id) && get_pcvar_num(CheckFPS)==1)
- {
- if(UserFPS[id] > get_pcvar_num(MaxFps) || UserFPS[id] <= 0)
- {
- if(++WarFps[id] >= 3)
- {
- WarFps[id] = 0;
- server_cmd("kick #%d ^"%d FPS Detected^"",get_user_userid(id),UserFPS[id])
- }
- }
- else
- {
- WarFps[id] = 0;
- }
- }
- }
- public client_disconnect(id)
- {
- if(task_exists(id)){
- remove_task(id)
- }
- }
- public Check_Cvar(id)
- {
- console_cmd(id,"cl_sidespeed 400;cl_forwardspeed 400;cl_backspeed 400;cl_yawspeed 210;m_pitch 0.022;m_yaw 0.022;cl_bob 0.01;cl_bobcycle 0.8;cl_bobup 0.5;cl_lw 1;cl_lc 1;cl_pitchspeed 225");
- query_client_cvar(id,"gl_ztrick_old","chsBuild");
- query_client_cvar(id,"gl_ztrick","chsBuild1");
- for(new i = 0; i < sizeof(g_CheckCvar); i++){
- query_client_cvar(id,g_CheckCvar[i],"AllCvar");
- }
- }
- public chsBuild(id,const szVar[],const szValue[]){
- if( szValue[0] != 'B' ) {
- sBuild_new[id]=true;
- }
- else
- {
- sBuild_new[id]=false;
- }
- }
- public chsBuild1(id,const szVar[],const szValue[]){
- if( szValue[0] != 'B' ) {
- sBuild_new[id]=false;
- }
- else
- {
- sBuild_new[id]=true;
- }
- }
- public AllCvar(id,const szVar[],const szValue[])
- {
- static szName[32],szIP[32];
- get_user_name(id, szName, charsmax(szName));
- get_user_ip(id, szIP, charsmax(szIP));
- if((equal(szVar, "cl_forwardspeed") && str_to_float(szValue) != 400)
- || (equal(szVar, "cl_sidespeed") && str_to_float(szValue) != 400)
- || (equal(szVar, "cl_backspeed") && str_to_float(szValue) != 400))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 400^"", get_user_userid(id),szVar)
- }
- if ((equal(szVar, "cl_yawspeed") && str_to_float(szValue) != 210))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 210^"", get_user_userid(id),szVar)
- }
- if ((equal(szVar, "developer") && str_to_float(szValue) != 0)
- || (equal(szVar, "cl_filterstuffcmd") && str_to_float(szValue) != 0)
- || (equal(szVar, "fps_override") && str_to_float(szValue) != 0)
- || (equal(szVar, "fps_modem") && str_to_float(szValue) != 0)
- || (equal(szVar, "gl_vsync") && str_to_float(szValue) != 0))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 0^"", get_user_userid(id),szVar)
- }
- if (sBuild_new[id] == false){
- if((equal(szVar, "fps_max") && (str_to_float(szValue) < 61 || str_to_float(szValue) > 101)))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 101^"",get_user_userid(id),szVar);
- }
- }
- if (sBuild_new[id] == true){
- if((equal(szVar, "fps_max") && (str_to_float(szValue) < 61 || str_to_float(szValue) > 99.5)))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 99.5^"",get_user_userid(id),szVar);
- }
- }
- if((equal(szVar, "m_pitch") && str_to_float(szValue) != 0.022)
- || (equal(szVar, "m_yaw") && str_to_float(szValue) != 0.022))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 0.022^"",get_user_userid(id),szVar);
- }
- if ((equal(szVar, "cl_bob") && str_to_float(szValue) != 0.01))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 0.01^"",get_user_userid(id), szVar);
- }
- if ((equal(szVar, "cl_bobcycle") && str_to_float(szValue) != 0.8))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 0.8^"",get_user_userid(id), szVar);
- }
- if ((equal(szVar, "cl_bobup") && str_to_float(szValue) != 0.5))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 0.5^"",get_user_userid(id), szVar);
- }
- if ((equal(szVar, "cl_lw") && str_to_float(szValue) != 1)
- || (equal(szVar, "cl_lc") && str_to_float(szValue) != 1))
- {
- ColorChat(0,NORMAL,"[^3Анти-Чит^1]Игрок ^4%s ^1Использует ^1[^4%s %s^1]",szName,szVar,szValue);
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 1^"",get_user_userid(id), szVar);
- }
- if(equal(szVar, "net_graph") && str_to_float(szValue) == 2)
- {
- new kick_or_write=get_pcvar_num(Netgraph)
- if(kick_or_write==1){
- console_cmd(id,"net_graph 1");
- }
- if(kick_or_write==3){
- console_cmd(id,"net_graph 3");
- }
- if(kick_or_write==0){
- server_cmd("kick #%d ^"Пожалуйста Пропишите В Консоль %s 0,1,3^"",get_user_userid(id),szVar);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment