Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- new PLUGIN[]="Anti net_graph 2"
- new VERSION[]="1.0"
- new AUTHOR[]="Seroff"
- #define CONFIG_FILE "addons/amxmodx/configs/anti_net_graph2.cfg"
- #define LOG_FILE "addons/amxmodx/logs/Detect_net_graph.log"
- new name[33][33],authid[33][33],ip[33][26],g_Logs,g_kick,g_netgraph,g_Time;
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- g_Logs = register_cvar("an_graph_logs","1")
- g_kick = register_cvar("an_graph_kick","1")
- g_netgraph = register_cvar("an_graph","1")
- g_Time = register_cvar("an_graph_task","5.0")
- }
- public plugin_cfg()
- {
- TryConfig()
- server_cmd("exec %s",CONFIG_FILE)
- }
- stock TryConfig() {
- if ( file_exists(CONFIG_FILE) )
- return false
- static line0[]= "// Проверяем ли включён anti net_graph 2 By Seroff"
- static line1[]= "an_graph_logs ^"1^" // Логи"
- static line2[]= "an_graph_task ^"5.0^" // Таймаут проверки"
- static line3[]= "an_graph_kick ^"1^" // При обнаружении кикать или вписовать, 0 вписовать, 1 кикать"
- static line4[]= "an_graph ^"3^" // Если вписовать то какой..."
- static line5[]= "echo ^"Anti net_graph 2 Config Executed^""
- static line6[]= "// Контактные данные: skype: cheats-2013; vk: vk.com/sachoc_pro"
- new CONFIG_SAVE[999]; formatex(CONFIG_SAVE, charsmax(CONFIG_SAVE), "%s^r^n%s^r%s^r%s^r%s^r%s^r^n%s", line0, line1, line2, line3, line4, line5, line6)
- new F = fopen( CONFIG_FILE , "w" )
- fputs( F , CONFIG_SAVE )
- fclose( F )
- return true
- }
- public client_putinserver(id)
- {
- new Float:iTime=get_pcvar_float(g_Time)
- set_task(iTime, "query_client", id, _, _, "b")
- }
- public client_disconnect(id)
- {
- remove_task(id)
- }
- public query_client(id)
- {
- query_client_cvar(id, "net_graph", "cvar_result_pitch")
- }
- public cvar_result_pitch(id, const cvar[], const value[])
- {
- if(!is_user_bot(id)||!is_user_hltv(id))
- {
- if( value[0] != 'B' ) {
- if ((!strcmp(cvar, "net_graph", 1)) && (str_to_num(value) == 2))
- {
- get_user_ip(id,ip[id],25, 1)
- get_user_name(id,name[id],32)
- get_user_authid(id,authid[id],32)
- new iLogsEnable=get_pcvar_num(g_Logs)
- if(iLogsEnable)
- {
- log_to_file(LOG_FILE,"[Anti Net Graph 2] DETECT «%s» SteamID «%s» | Reason : [%s %s]",name[id], authid[id], cvar,value)
- }
- ColorChat(0, "^4[^3Anti-Cheat^4]^1Игрок ^4%s ^1Использует ^4[^3%s %s^4]",name[id], cvar, value)
- if(get_pcvar_num(g_kick))
- {
- new g_print[][] = { "[Anti-Cheat] *********************" };
- new g_print1[][] = { "[Anti-Cheat] Требуеться прописать net_graph 0 или 1 или 3 в консоле" };
- client_print(id,print_console,"%s",g_print)
- client_print(id,print_console,"[Anti-Cheat] Ник: %s | IP: %s",name[id],ip[id])
- client_print(id,print_console,"%s",g_print1)
- client_print(id,print_console,"%s",g_print)
- server_cmd("kick #%d %s %s Detected", get_user_userid(id), cvar, value);
- }
- else
- {
- new iNetGraph=get_pcvar_num(g_netgraph)
- switch(iNetGraph)
- {
- case 0:
- {
- console_cmd(id,"net_graph 0")
- }
- case 1:
- {
- console_cmd(id,"net_graph 1")
- }
- case 2:
- {
- set_fail_state("an_graph 2 error, an_graph 0, 1, 3 ");
- }
- case 3:
- {
- console_cmd(id,"net_graph 3")
- }
- }
- }
- }
- }
- }
- }
- /* Сток цветного чата */
- stock ColorChat(const id, const input[], any:...)
- {
- new count = 1, players[32]
- static msg[191]
- vformat(msg, 190, input, 3)
- replace_all(msg, 190, "!g", "^4") // Зелёный
- replace_all(msg, 190, "!y", "^1") // Стандартный
- replace_all(msg, 190, "!t", "^3") // Цвет команды
- if (id) players[0] = id; else get_players(players, count, "ch")
- {
- for (new i = 0; i < count; i++)
- {
- if (is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment