Вот исходник. Тут уже вставил print_chat. Компилируется,но не выводится сообщение о бане в чат игрокам...
Код:
#include <amxmodx>
#define PLUGIN "Wallhack files"
#define VERSION "1.5"
#define AUTHOR "Pike"
new s_Check[33][26]
new s_File[] = "../opengl32.dll"
new s_NextFile[] = "../opengl32/opengl32.dll"
new s_NextFile2[] = "../opengl32_2.dll"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("anti_wallhack_bantime", "43200") // 30 Days BAN (43200 minutes)
register_cvar("anti_wallhack_bantype", "2") // 0 - Kick; 1 - Ban IP; 2 - AMXBANS 5; 3 - AdvancedBans; 4 - AMXBANS 6
if (!dir_exists("../opengl32"))
{
server_print("[Wallhack Files] No dir opengl32 !!!")
return PLUGIN_CONTINUE
}
rename_file(s_File, s_NextFile2, 1)
rename_file(s_NextFile, s_File, 1)
rename_file(s_NextFile2, s_NextFile, 1)
return PLUGIN_HANDLED
}
public plugin_precache()
{
force_unmodified(force_exactfile, {0,0,0},{0,0,0}, s_File)
}
public inconsistent_file(id, const filename[], reason[64])
{
new s_Name[32], s_AuthID[32], s_IP[32]
get_user_authid(id, s_AuthID, sizeof(s_AuthID)-1)
get_user_ip(id, s_IP, 31, 1)
get_user_name(id, s_Name, sizeof(s_Name)-1)
get_user_userid(id)
if(containi(filename, s_File) != -1)
copy(s_Check[id], 25, s_File)
return PLUGIN_HANDLED
}
public client_putinserver(id)
{
if ((is_user_hltv(id)) || (is_user_bot(id)) || (!file_exists (s_File)))
return PLUGIN_CONTINUE
set_task(5.0, "check_file", id)
return PLUGIN_HANDLED
}
public check_file(id)
{
new s_Name[32], s_AuthID[32], s_IP[32]
get_user_authid(id, s_AuthID, sizeof(s_AuthID)-1)
get_user_ip(id, s_IP, 31, 1)
get_user_name(id, s_Name, sizeof(s_Name)-1)
if(s_Check[id][0]==0)
{
set_hudmessage(140, 0, 0, 0.05, 0.70, 0, 6.0, 4.0)
show_hudmessage(0,"[Anti-Cheats] Violation by %s ^n[Anti-Cheats] Violation: Wallhack OpenGL", s_Name)
switch(get_cvar_num("anti_wallhack_bantype"))
{
case 0:
server_cmd("kick #%d [Anti-Cheats] Wallhack OpenGL", get_user_userid(id))
case 1:
server_cmd("addip %d %s; writeip", get_cvar_num("anti_wallhack_bantime"), s_IP)
case 3:
if ( containi(s_AuthID, "STEAM_0:") > -1)
server_cmd("amx_ban #%d %d ^"Wallhack OpenGL^"", get_user_userid(id), get_cvar_num("anti_wallhack_bantime"))
else
server_cmd("amx_banip #%d %d ^"Wallhack OpenGL^"", get_user_userid(id), get_cvar_num("anti_wallhack_bantime"))
case 4:
server_cmd("amx_ban #%d %d ^"Wallhack OpenGL^"", get_user_userid(id), get_cvar_num("anti_wallhack_bantime"))
default:
server_cmd("amx_ban %d #%d ^"Wallhack OpenGL^"", get_cvar_num("anti_wallhack_bantime"), get_user_userid(id))
}
log_to_file("addons\amxmodx\logs\detectionlist.txt","[Anti-Cheats] -> %s<%s><%s> <Wallhack OpenGL>", s_Name, s_IP, s_AuthID)
}
else
setc(s_Check[id], 25 ,0)
return PLUGIN_HANDLED
}
public client_disconnect(id)
{
if(task_exists(id))
remove_task(id)
}