AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [DELETED] (https://forums.alliedmods.net/showthread.php?t=313625)

Shadowless 01-16-2019 10:03

[DELETED]
 
---

Nutu_ 01-16-2019 11:08

Re: [req] blacklist ip
 
in your case what's blacklist meaning?
you want to ban by ip spamers? or gag, or kick?

X3. 01-16-2019 11:49

Re: [req] blacklist ip
 
Quote:

Originally Posted by Nutu_ (Post 2635033)
in your case what's blacklist meaning?
you want to ban by ip spamers? or gag, or kick?

I think he means to add IPS in a text file (.ini). And when the user with this IP connects, the server automatically kicks him with a reason of not whitelisted, or you're blacklisted from this server. Not a ban, or its kinda like IP adress ban but he can control it from the file to add and remove

Mordekay 01-16-2019 11:58

Re: [req] blacklist ip
 
Banning by IP is simply stupid. Once the one you wanted to ban and anotherone gets this IP he will be banned for no reason. Hence why STEAM_ID was designed.
Why do you want to ban by IP instead?

Mordekay 01-16-2019 13:36

Re: [req] blacklist ip
 
Simply enable logging for ban/unban and remove those admin rights who unban banned IDs. Whatever system you choose, admins can unban anyone.

OciXCrom 01-16-2019 15:20

Re: [req] blacklist ip
 
https://forums.alliedmods.net/showthread.php?t=267526

OciXCrom 01-16-2019 16:42

Re: [req] blacklist ip
 
Quote:

Originally Posted by Shadowless (Post 2635066)
looks like CRONjob ?

Not exactly. You can assign the kick command on IP addresses and the player will get kicked once he joins.

raizo11 01-17-2019 12:33

Re: [req] blacklist ip
 
Code:

#include <amxmodx>
#include <amxmisc>

new Trie:g_BlockIp;
new g_File[ 64 ];

new const Message[] = "Ip Blocked";

public plugin_init()
{
    new szData[ 35 ];
   
    g_BlockIp = TrieCreate();
   
    copy( g_File[ get_localinfo( "amxx_configsdir" , g_File , charsmax( g_File ) ) ] , charsmax( g_File ) , "/IpWhiteLits.ini" );
   
    new f = fopen( g_File , "rt" );
   
    while( !feof( f ) )
    {
        fgets( f , szData , charsmax( szData ) );
   
        trim( szData );
       
        if( !szData[0] || szData[0] == ';' || szData[0] == '/' && szData[1] == '/' )
            continue;
           
        TrieSetCell( g_BlockIp , szData , 1 );
    }
   
    fclose( f );
   
    register_concmd( "amx_blockip" , "Add_User_Ip" , ADMIN_KICK , "<IP> - Add User IP to list" );
}

public client_connect( id )
{
    new szIP[ 32 ];
   
    get_user_ip(id, szIP, charsmax(szIP), 1);

    if ( TrieKeyExists( g_BlockIp , szIP[ contain( szIP, "" ) + 1 ]) )
    {
        message_begin( MSG_ONE, SVC_DISCONNECT, .player = id );
        write_string( Message );
        message_end();
    }
    else
    {
        //nothing
    }
}

public Add_User_Ip( id , level , cid )
{
    if ( !cmd_access( id , level , cid , 2 ) )
        return PLUGIN_HANDLED;
       
    new szIP[ 32 ];

    if ( read_argv( 1 , szIP , charsmax( szIP ) ) )
    {
        if ( !TrieKeyExists( g_BlockIp , szIP ) )
        {
            TrieSetCell( g_BlockIp , szIP , 1 );
            write_file( g_File , szIP );
            console_print( id , "* Added IP ^"%s^" to list." , szIP );
        }
        else
        {
            console_print( id , "* IP ^"%s^" already exists in list." , szIP );
        }
    }
   
    return PLUGIN_HANDLED;
}



All times are GMT -4. The time now is 16:54.

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