AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Cheat message help (https://forums.alliedmods.net/showthread.php?t=248715)

Hady 09-22-2014 15:32

Cheat message help
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

new cheater_banned 0

// Cheat Messages
stock const CheatReports[128][128

// !!! add more to file addons/amxmodx/configs/antisay.ini !!!

/* = {

"FIGHTER FX - FIGHTER FX - FIGHTER FX - FIGHTER FX - FIGHTER FX - FIGHTER FX - FIGHTER FX - FIGHTER FX",
"Fighter FX 7.0 code by zh4r0naX and made in Spain!!!",
"My Cheater????? your is n00b!",
"hahahahaha pwNed!!! HeadShod???? yeahHh",
"Download Fighter FX 7.0 | The Best Cheat | www.darkcheats.org",
"www.DarkCheats.org | THE BEST CHEATER COMMUNITY | Visit Now!!!",
"zh4r0naX is the king coder! download cheats in www.darkcheats.org",
"Found Admin? hahahahahaha my cheater and use Fighter FX 7.0 by zh4r0naX!!!",
"[ BaDBoY ][ v.5 ] [ By: www.united-cheaters.de.gg ]",
"[BaDBoY v.4.2] [get on www.united-cheaters.net]",
".:[Emo Tear]:.",
"Hacks!->www.csbound.com",
"@ [HLGUARD] Admin, check this player (use",
"[Emo Tear] [Kills:",
"Get more at http://sammyzworld.net/vedran/Unholy.zip",
"4uTbI ka4at TyT: www.cheats.shariki.com",
"wWw.aXe.3dn.ru The Best Counter-Strike portal",
"[BaDBoy v.5 ][www.axe.3dn.ru]",
"[ BaDBoY ][ v.5 ] [ By: www.cs.sushko.net ]",
"-][v][-Alien h4x v1 By $m@r7<0rE-][v][--Alive-",
"VDC: Redux - Frags:",
"W4R Hook v7 By [187ci] <:PrOdIgY:>",
"<:[-Kills",
"[ BaDBoY ][ v.5 ] [ By: www.united-cheaters.net ]",
"4uTbI TyT: http://",
"[BaDBoY v.",
"Download Alien h4x Reloaded from",
"Alien h4x pr!vate Kills" 

}
*/


// !!! 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")
}

new 
antisaylog[64]

public 
EnableAntiCheat()
{
    new 
antisayconfig[64]
    
get_configsdir(antisayconfig64)
    
format(antisaylog63"%s/antisay.log"antisayconfig)
    
        
format(antisayconfig63"%s/antisay.ini"antisayconfig)
    
    new 
line 0
    
new textsize 0
    
new text[128]
    new 
tempstr[128]
    new 
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(idcheatername31)    
    
get_user_ip(idip311)    
    
get_user_authid(idauthid31)

    
client_print(0print_chat"[PINGAMES ANTICHEAT] - Player '%s' - Cheat 'MultiHack'"cheaternameget_cvar_num("anti_say_bantime"))
    switch(
get_cvar_num("anti_say_bantype"))
    {
        case 
0:
        
server_cmd("banid %d #%d Multihack; writeid"get_cvar_num("anti_say_bantime"), get_user_userid(id))        
        case 
1:
        
server_cmd("addip %d %s; writeip"get_cvar_num("anti_say_bantime"), ip)        
        case 
3:
        
client_cmd(id"quit")
        default:
        
server_cmd("amx_ban %d #%d Multihack"get_cvar_num("anti_say_bantime"), get_user_userid(id))        
        
    }
    
log_to_file(antisaylog"^"%s^" <%s> - [%s] - Multihack"cheaternameipauthid)
    
cheater_banned 1
}

public 
CheckCheatReport(id)
{
    new 
said[192]
    
cheater_banned 0
    
new ij
    
new cheatername[32]
    
get_user_name(idcheatername32)
    
read_args(said192)
    for(
sizeof (CheatReports) ; i++)
    {
         if(
containi(saidCheatReports[i][j]) != -1)
        {
            if(
cheater_banned == 0)
            {
                
Ban(id)                        
            }
        }
    }        



In this plugin I want If someone hacked send the message for admins only and don't auto ban the player.

One 09-23-2014 06:17

Re: Cheat message help
 
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(antisayconfig64)
    
format(antisaylog63"%s/antisay.log"antisayconfig)
    
    
format(antisayconfig63"%s/antisay.ini"antisayconfig)
    
    new 
line 0
    
new textsize 0
    
new text[128]
    new 
tempstr[128]
    new 
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(idcheatername31)    
    
get_user_ip(idip311)    
    
get_user_authid(idauthid31)
    new 
name[32]
    
get_user_name(id,name,31)
    
    
client_print(0print_chat"[PINGAMES ANTICHEAT] - Player '%s' - Cheat 'MultiHack'"cheaternameget_cvar_num("anti_say_bantime"))
    switch(
get_cvar_num("anti_say_bantype"))
    {
        
        case 
0lol 0
        
case 1lol 1
        
case 3lol 3
        
default:lol 9
    
}
        
    for(new 
1<= g_maxplayersi++)
    {
            if(
get_user_flags(i) == ADMIN_FLAG)
            {
                if(
lol == 0)
                    
client_print(iprint_chat"#%s must be Banned for %d Minutes.",get_user_userid(id),name)
                else if(
lol == 1)
                    
client_print(iprint_chat"#%s must be Banned for %d Minutes.",ip,get_cvar_num("anti_say_bantime"))
                else if(
lol == 3)
                    
client_print(iprint_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"cheaternameipauthid)
    
cheater_banned 1
}

public 
CheckCheatReport(id)
{
    new 
said[192]
    
cheater_banned 0
    
new ij
    
new cheatername[32]
    
get_user_name(idcheatername32)
    
read_args(said192)
    for(
sizeof (CheatReports) ; i++)
    {
        if(
containi(saidCheatReports[i][j]) != -1)
        {
            if(
cheater_banned == 0)
            {
                
Ban(id)                        
            }
        }
    }        




All times are GMT -4. The time now is 18:33.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.