Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #define CONFIG_FILE "addons/amxmodx/configs/anti_filtercmd.cfg"
- #define LOG_FILE "addons/amxmodx/logs/Detect_FilterCMD.log"
- new szName[32],ip[33][26],g_Logs,g_Time,g_iSayText,szFileComment[33];
- new g_print[][] = { "[Anti-Cheat] *********************","[Anti-Cheat] Требуеться прописать cl_filterstuffcmd 0 в консоле" };
- static PLUGIN[][]={ "Anti cl_filterstuffcmd", "1.5", "Seroff" };
- public plugin_init(){
- register_plugin(PLUGIN[0], PLUGIN[1], PLUGIN[2]);
- g_Logs = register_cvar("filtercmd_logs","1");
- g_Time = register_cvar("filtercmd_task","5.0");
- }
- public plugin_cfg(){
- if(!file_exists(CONFIG_FILE)){
- formatex(szFileComment,sizeof(szFileComment)-1,"// %s v%s By %s^n",PLUGIN[0],PLUGIN[1],PLUGIN[2]);
- write_file(CONFIG_FILE,szFileComment,-1);
- write_file(CONFIG_FILE,"filtercmd_logs ^"1^" // Логи^nfiltercmd_task ^"5.0^" // Таймаут проверки^n",-1);
- write_file(CONFIG_FILE,"echo ^"^"^necho ^"Anti cl_filterstuffcmd Config Executed^"^necho ^"^"^n",-1);
- write_file(CONFIG_FILE,"// Контактные данные: skype: cheats-2013; vk: vk.com/sachoc_pro",-1);
- write_file(CONFIG_FILE,"",-1);
- }
- server_cmd("exec %s",CONFIG_FILE);
- server_exec();
- }
- public client_putinserver(id){
- new Float:iTime=get_pcvar_float(g_Time);
- set_task(iTime, "query_client", id, _, _, "b");
- g_iSayText = get_user_msgid("SayText");
- }
- public client_connect(id){
- set_task(0.1, "query_client", id);
- }
- public client_disconnect(id){
- remove_task(id);
- }
- public query_client(id){
- query_client_cvar(id, "cl_filterstuffcmd", "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, "cl_filterstuffcmd", 1)) && (str_to_num(value) != 0)) {
- get_user_name(id, szName, sizeof(szName)-1);
- get_user_ip(id,ip[id],25, 1);
- ColorChat(0, "^4[^3Anti-Cheat^4]^3Игрок ^4%s ^3Использует ^4[^3cl_filterstuffcmd %s^4]",szName, value);
- client_print(id,print_console,"%s",g_print[0]);
- client_print(id,print_console,"[Anti-Cheat] Ник: %s | IP: %s",szName,ip[id]);
- client_print(id,print_console,"%s",g_print[1]);
- client_print(id,print_console,"%s",g_print[0]);
- new iLogsEnable=get_pcvar_num(g_Logs);
- if(iLogsEnable){
- log_to_file(LOG_FILE,"[Steam Filter CMD] DETECT «%s» | Reason : [cl_filterstuffcmd %s]",szName,value);
- }
- server_cmd("kick #%d ^"cl_filterstuffcmd %s Detected^"", get_user_userid(id), value);
- }
- }
- }
- }
- ColorChat(id, fmt[], any:...){
- new szMsg[192];
- szMsg[0] = 0x04;
- vformat(szMsg[1], charsmax(szMsg)-1, fmt, 3);
- message_begin(id ? MSG_ONE : MSG_ALL, g_iSayText, _, id)
- {
- write_byte(id ? id : 1);
- write_string(szMsg);
- }
- message_end();
- }
Add Comment
Please, Sign In to add comment