mSoft BlackList Players by MaSTeR

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
hello again...
few days ago i updated amxx to 1.9.0...
and now this plugin does not work
there is no erros in logs and its runing with out problem but does not ban
compiled with 1.9.0

C++:
// *************************************************************************************//
// Master Software Romania CS 1.6 Dedicated Server - PLUGINS
// Plugin Name: mSoft BlackList Players (ban pe clasa de IP)
// Author: Master Sorynel - [c] 2011 FOR CS.MASTER-SOFTWARE.RO
// *************************************************************************************//

#include <amxmodx>
#include <amxmisc>
#include <file>

new t;

enum INFO { NAME, AUTHOR, VERSION }

new const PLUGIN[INFO:3][] = { "mSoft BlackList Players","MaSTeR + georgeml","1.1" }

public plugin_init()
{
    register_plugin(PLUGIN[NAME],PLUGIN[VERSION],PLUGIN[AUTHOR])
}

public client_putinserver(id)
{
    new user[32];
    get_user_name(id,user,31)
    set_task(15.0,"mSoftVerificaClasaDeIp",id)
    /* server_cmd("amx_chat [AP] Checking IP of %s on blacklist.",user) */
    /* server_cmd("amx_chat [AP] IP of %s is checked automatically by the system.",user) */
    /* server_cmd("amx_chat [AP] If you get BAN, it means that the IP is blacklisted!") */
}

public mSoftVerificaClasaDeIp(id)
{
        if(is_user_connected(id))
    {
        new user[32],ip[32], clasaIpA[10];
        get_user_name(id,user,31)
        get_user_ip(id,ip,31,1)
        get_user_ip(id,clasaIpA,9,1)
        new counterIpuri;
        counterIpuri = 0
        new f = fopen("/addons/amxmodx/configs/blacklist.ini","r")
        new data[128]
        while( !feof(f) )
        {
            fgets(f, data, 127)
            if(data[0] != ';')
            {
                counterIpuri++;
            }
        }
        fclose(f)
        new fisierBlackList[128],clasaIpB[24];
        format(fisierBlackList, 127, "/addons/amxmodx/configs/blacklist.ini")
        for (new i=0; i<counterIpuri; i++)
        {
            read_file(fisierBlackList, i, clasaIpB, charsmax(clasaIpB), t)
            /* replace_all(clasaIpA, 9, ".", "") */
            /* replace_all(clasaIpB, 9, ".", "") */
            if (equal(clasaIpB, clasaIpA))
            {
                set_task(5.0,"mSoftAdaugaBanPermanent",id)
                /* client_print(id,print_chat,"[AP] Ops.. %s it seems that you have been punished by this server. PERMANENT BAN on IP!",user) */
                client_print(id,print_chat,"[AP] If you think that this BAN is wrong, contact us on FB")
            }
        }
    }
}

public mSoftAdaugaBanPermanent(id)
{
        if(is_user_connected(id))
    {
        new user[32],ip[32];
        get_user_name(id,user,31)
        get_user_ip(id,ip,31,1)
        client_print(0,print_chat,"[AP] %s was punished by this server. PERMANENT BAN on IP!",user)
        server_cmd("amx_chat [AP] %s was punished by this server. PERMANENT BAN - Blacklisted IP!",user)
        server_cmd("amx_addban %s 0 ^"Blacklisted IP^"",ip)
        server_cmd("amx_ban %s 0 ^"Blacklisted IP^"",ip)
        server_cmd("addip 0.0 %s ^"Blacklisted IP^"",ip)

    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
 
Последнее редактирование:

ifx

Пользователь
Регистрация
11 Фев 2018
Сообщения
361
Симпатии
148
do u have this file? /addons/amxmodx/configs/blacklist.ini
 

Shadowless

Пользователь
Регистрация
24 Фев 2019
Сообщения
237
Симпатии
4
Пол
Мужской
C++:
// *************************************************************************************//
// Master Software Romania CS 1.6 Dedicated Server - PLUGINS
// Plugin Name: mSoft BlackList Players (ban pe clasa de IP)
// Author: Master Sorynel - [c] 2011 FOR CS.MASTER-SOFTWARE.RO
// *************************************************************************************//

#include <amxmodx>
#include <amxmisc>
#include <file>
#include <colorchat>

new t;

enum INFO { NAME, AUTHOR, VERSION }

new const PLUGIN[INFO:3][] = { "mSoft IP BlackList Players","MaSTeR + georgeml","1.0" }

public plugin_init()
{
    register_plugin(PLUGIN[NAME],PLUGIN[VERSION],PLUGIN[AUTHOR])
}

public client_putinserver(id)
{
    new user[32];
    get_user_name(id,user,31)
    set_task(15.0,"mSoftVerificaClasaDeIp",id)
}

public mSoftVerificaClasaDeIp(id)
{
    if(is_user_connected(id) == 1)
    {
        new user[32]
        new clasaIpA[24];
        
        get_user_name(id,user,31)
        get_user_ip(id,clasaIpA,31,1)
        
        new counterIpuri;
        counterIpuri = 0
        new f = fopen("/addons/amxmodx/configs/blacklist_IP.ini","r")
        new data[128]
        while( !feof(f) )
        {
            fgets(f, data, 127)
            if(data[0] != ';')
            {
                counterIpuri++;
            }
        }
        fclose(f)
        
        new fisierBlackList[128]
        new clasaIpB[24];
        
        format(fisierBlackList, 127, "/addons/amxmodx/configs/blacklist_IP.ini")
        for (new i=0; i<counterIpuri; i++)
        {
            read_file(fisierBlackList, i, clasaIpB, charsmax(clasaIpB), t)
            //replace_all(clasaIpA, 9, ".", "")
            //replace_all(clasaIpB, 9, ".", "")
            if (equal(clasaIpB, clasaIpA))
            {
                set_task(5.0,"mSoftAdaugaBanPermanent",id)
            }
        }
    }
}

public mSoftAdaugaBanPermanent(id)
{
    if(is_user_connected(id) == 1)
    {
        new blacknick[32]
        new blackip[32]
        new blackauthid[35];
        get_user_name(id,blacknick,31)
        get_user_authid(id, blackauthid, charsmax(blackauthid))
        get_user_ip(id, blackip, charsmax(blackip), 1/*no port*/)
        
        server_cmd("amx_chat [AMXX] %s was kicked by server. Blacklist IP! ",blacknick)
        client_print(0,print_chat,"[AMXX] %s was kicked by this server. Blacklist IP!",blacknick)
        
        ColorChat(id,NORMAL, "^1[^4AMXX^1] ^3%s ^1was kicked by server. ^4Blacklist IP! ",blacknick)
        
        server_cmd("amx_banip %s 0 Blacklisted!",blacknick)
        server_cmd("amx_ban %s 0 Blacklisted!",blacknick)
        server_cmd("amx_addban ^"%s^" 0 Blacklisted!",blackip)
        server_cmd("addip 0.0 %s;writeip",blackip)
        server_cmd("kick #%d Blacklisted!", get_user_userid(id))
    }
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
 
Сверху Снизу