Jump to content

★ PLUGIN ★ Anti Fake Players


CSFWEED

Recommended Posts

#Denumire plugin: Anti Fake Players
#Autor: Cosmin 
#Informatii: Acest plugin da ban jucatorilor/botilor care intra si fac reclama,de exemplu daca scrie un cuvant mai lung de 15 caractere de 3 ori (aici puteti modifica cvarul) consecutiv v-a primii ban x minute (setat prin cvar),bineinteles poate bana si jucatori nevinovati care scriu de 3 ori acelasi cuvant dar mai mare de 15 caractere,de aceea se vor salva intr-un log in configs.
Foarte rar baneaza jucatori 'nevinovati' deoarece nu prea au ce sa scrie acestia de 3 ori consecutiv acelasi cuvant si mai mare de 15 caractere,98% sunt boti care indeplinesc conditiile astea.De asemenea sa aveti instalat advanced bans pe server pe care-l descarcati de aici: https://forums.alliedmods.net/showthread.php?t=80858

#Link download: 

  • v5.0 |

    #include <amxmodx>

    new const
        PLUGIN[] = "Anti FakePlayers",
        VERSION[] = "5.0",
        AUTHOR[] = "scosmyn";

    new Count[33],Args[33][192],bool:bCount[33] = false,bool:bCount2[33] = false
    new pcvar_count_command,pcvar_ban_time,pcvar_numar_caractere

    #define LOG    "addons/amxmodx/configs/player_info.txt"

    public plugin_init() {
        register_plugin(PLUGIN,VERSION,AUTHOR)

        register_clcmd("say","cmdSay")
        register_clcmd("say_team","cmdSay")

        pcvar_count_command = register_cvar("cvar_count_command","3")
        pcvar_ban_time = register_cvar("cvar_ban_time","120")
        pcvar_numar_caractere = register_cvar("cvar_numar_caractere","15")
    }

    public cmdSay(id) {
        new szArgs[192],cvarr
        read_args(szArgs,charsmax(szArgs))
        remove_quotes(szArgs)
        trim(szArgs)
        trim(Args[id])
        cvarr = get_pcvar_num(pcvar_numar_caractere)
        if(!bCount[id] && strlen(szArgs) > cvarr && !is_admin(id))
        {
            bCount[id] = true
            copy(Args[id],charsmax(Args[]),szArgs)
        }
        if(equal(szArgs,Args[id]) && strlen(szArgs) > cvarr && !is_admin(id))
        {
            bCount2[id] = true
            Count[id]++
            if(Count[id] == get_pcvar_num(pcvar_count_command))
                set_task(0.1,"add_player",id)
            if(Count[id] > 1)
            {
                copy(Args[id],charsmax(Args[]),szArgs)
                color(id,"!g***!teamRECLAMA!g***")
                return 1
            }
        }
        else
        {
            if(bCount2[id] && Count[id] > 1)
            {
                Count[id] = 1
                bCount[id] = true
                bCount2[id] = false
            }
        }
        if(!is_admin(id))
            copy(Args[id],charsmax(Args[]),szArgs)
        return 0
    }
    public add_player(id) {
        new name[32],ip[32]
        new szReason[32] = "FakePlayers/Reclama"
        get_user_name(id,name,charsmax(name))
        get_user_ip(id,ip,charsmax(ip),1)
        server_cmd("amx_banip ^"%s^" ^"%i^" ^"%s^"",name,get_pcvar_num(pcvar_ban_time),szReason)
        log_to_file(LOG,"Jucator-ul cu numele: %s IP: %s a primit ban %i minute,motiv: %s^n%s : %s",name,ip,get_pcvar_num(pcvar_ban_time),szReason,name,Args[id])
        Count[id] = 0
        bCount[id] = false
    }

    public client_putinserver(id) {
        bCount[id] = false
        bCount2[id] = false
        Count[id] = 0
    }

    public client_disconnect(id) {
        if(task_exists(id))
            remove_task(id)
    }
    stock bool:is_admin(id) {
        if(get_user_flags(id) & read_flags("c"))
            return true
        return false
    }
    stock color(const id,const input[],any:...) {
        new count = 1,players[32]

        static msg[191]
        vformat(msg,190,input,3)

        replace_all(msg,190,"!g","^4")    //verde
        replace_all(msg,190,"!y","^1") //- galben
        replace_all(msg,190,"!team","^3") //- echipa
        replace_all(msg,190,"!n","^0") //- normal

        if(id) players[0] = id; else get_players(players,count,"ch")
        {
            for(new i = 0; i < count; i++)
            {
                if(is_user_connected(players))
                {
                    message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players)
                    write_byte(players)
                    write_string(msg)
                    message_end()
                }
            }
        }
    }

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use & Privacy Policy