PHP Code:
#include <amxmodx>
#include <amxmisc>
#define ADMIN_FLAG ADMIN_IMMUNITY
new cheater_banned = 0
// Cheat Messages
stock const CheatReports[128][128]
new lol
new g_maxplayers
// !!! add more to file addons/amxmodx/configs/antisay.ini !!!
public plugin_init()
{
register_plugin("Cheat Messages Ban","1.4","dr.aft")
register_clcmd("say", "CheckCheatReport")
register_clcmd("say_team", "CheckCheatReport")
register_cvar("anti_say_bantime", "7200") // 5 Days BAN (7200 minutes)
register_cvar("anti_say_bantype", "2") // 3 - Kicking only 2 - AMXBANS, 1 - IP, 0 - SteamID
set_task(1.0, "EnableAntiCheat")
g_maxplayers = get_maxplayers()
}
new antisaylog[64]
public EnableAntiCheat()
{
new antisayconfig[64]
get_configsdir(antisayconfig, 64)
format(antisaylog, 63, "%s/antisay.log", antisayconfig)
format(antisayconfig, 63, "%s/antisay.ini", antisayconfig)
new line = 0
new textsize = 0
new text[128]
new tempstr[128]
new i = 0
if (file_exists(antisayconfig))
{
while(read_file(antisayconfig,line,text,255,textsize))
{
format(tempstr,128,"%s",text)
CheatReports[i++]=tempstr
line++
}
}
}
public Ban(id)
{
new cheatername[32], ip[32], authid[32]
get_user_name(id, cheatername, 31)
get_user_ip(id, ip, 31, 1)
get_user_authid(id, authid, 31)
new name[32]
get_user_name(id,name,31)
client_print(0, print_chat, "[PINGAMES ANTICHEAT] - Player '%s' - Cheat 'MultiHack'", cheatername, get_cvar_num("anti_say_bantime"))
switch(get_cvar_num("anti_say_bantype"))
{
case 0: lol = 0
case 1: lol = 1
case 3: lol = 3
default:lol = 9
}
for(new i = 1; i <= g_maxplayers; i++)
{
if(get_user_flags(i) == ADMIN_FLAG)
{
if(lol == 0)
client_print(i, print_chat, "#%s must be Banned for %d Minutes.",get_user_userid(id),name)
else if(lol == 1)
client_print(i, print_chat, "#%s must be Banned for %d Minutes.",ip,get_cvar_num("anti_say_bantime"))
else if(lol == 3)
client_print(i, print_chat, "#%s must quit",name)
else
client_print(i,print_chat, "#%s must be banned for %d minutes.",name,get_cvar_num("anti_say_bantime"))
}
}
log_to_file(antisaylog, "^"%s^" <%s> - [%s] - Multihack", cheatername, ip, authid)
cheater_banned = 1
}
public CheckCheatReport(id)
{
new said[192]
cheater_banned = 0
new i, j
new cheatername[32]
get_user_name(id, cheatername, 32)
read_args(said, 192)
for(i = 0 ; i < sizeof (CheatReports) ; i++)
{
if(containi(said, CheatReports[i][j]) != -1)
{
if(cheater_banned == 0)
{
Ban(id)
}
}
}
}