Raised This Month: $32 Target: $400
 8% 

[REQ] Ban ip/steamid even if player not on server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tomslayer
Junior Member
Join Date: Nov 2009
Old 11-01-2009 , 11:45   [REQ] Ban ip/steamid even if player not on server
Reply With Quote #1

I've recently upgraded my server configuration and thus i've switched from adminmod to amxmodx + statsme

a thing that i dont like at amxmodx is that if a player leaves the server there's no way to ban him(i googled around and didnt' find a solution)

it would be cool if someone would create a small plugin which would allow admins to ban ips or steamids even if a player isn't on the server

Thanks,
Tom
tomslayer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-01-2009 , 13:12   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #2

Code:
amx_addban STEAM_0:0:1234
Bans players that have recently left. List them with amx_last.
__________________
fysiks is offline
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 11-01-2009 , 18:36   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #3

yea...but that's something that bothers me... i can't addban someone not in the amx_last list ... my low-level admins ( don't have ban access ) catch some cheaters on the server, and they post a demo + id on the forum, and i always have to
Code:
rcon addid 0 id;writeid;
when i could do with amx_addban "id" 0 much better since i could allow ban-access w/o rcon admins to ban them if i am too busy to check the forum one day
__________________


Trafalete is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-01-2009 , 18:40   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #4

You could simply remove the old connections check and make it so all amx_addban request go straight to banid.

I'm a bit spoiled on my clan's server. We can add SteamIDs to the banned list with the same command we ban in-game players.
__________________
fysiks is offline
tomslayer
Junior Member
Join Date: Nov 2009
Old 11-02-2009 , 05:43   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #5

Quote:
Originally Posted by Trafalete View Post
yea...but that's something that bothers me... i can't addban someone not in the amx_last list ... my low-level admins ( don't have ban access ) catch some cheaters on the server, and they post a demo + id on the forum, and i always have to
Code:
rcon addid 0 id;writeid;
when i could do with amx_addban "id" 0 much better since i could allow ban-access w/o rcon admins to ban them if i am too busy to check the forum one day
exactly what i wanted to point out
Quote:
You could simply remove the old connections check and make it so all amx_addban request go straight to banid.
could you expand on that?

thanks,
Tom
tomslayer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-02-2009 , 18:40   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #6

Just put in the /* and */

PHP Code:
public cmdAddBan(idlevelcid)
{
    if (!
cmd_access(idlevelcid3true)) // check for ADMIN_BAN access
    
{
        if (
get_user_flags(id) & level// Getting here means they didn't input enough args
        
{
            return 
PLUGIN_HANDLED;
        }
        if (!
cmd_access(idADMIN_RCONcid3)) // If somehow they have ADMIN_RCON without ADMIN_BAN, continue
        
{
            return 
PLUGIN_HANDLED;
        }
    }

    new 
arg[32], authid[32], name[32], minutes[32], reason[32]
    
    
read_argv(1arg31)
    
read_argv(2minutes31)
    
read_argv(3reason31)
    
/*    
    if (!(get_user_flags(id) & ADMIN_RCON))
    {
        new bool:canban = false;
        new bool:isip = false;
        // Limited access to this command
        if (equali(arg, "STEAM_ID_PENDING") ||
            equali(arg, "STEAM_ID_LAN") ||
            equali(arg, "HLTV") ||
            equali(arg, "4294967295") ||
            equali(arg, "VALVE_ID_LAN") ||
            equali(arg, "VALVE_ID_PENDING"))
        {
            // Hopefully we never get here, so ML shouldn't be needed
            console_print(id, "Cannot ban %s", arg);
            return PLUGIN_HANDLED;
        }
        
        if (contain(arg, ".") != -1)
        {
            isip = true;
        }
        
        // Scan the disconnection queue
        if (isip)
        {
            new IP[32];
            new Name[32];
            new dummy[1];
            new Access;
            for (new i = 0; i < g_Size; i++)
            {
                GetInfo(i, Name, charsmax(Name), dummy, 0, IP, charsmax(IP), Access);
                
                if (equal(IP, arg))
                {
                    if (Access & ADMIN_IMMUNITY)
                    {
                        console_print(id, "[AMXX] %s : %L", IP, id, "CLIENT_IMM", Name);
                        
                        return PLUGIN_HANDLED;
                    }
                    // User did not have immunity
                    canban = true;
                }
            }
        }
        else
        {
            new Auth[32];
            new Name[32];
            new dummy[1];
            new Access;
            for (new i = 0; i < g_Size; i++)
            {
                GetInfo(i, Name, charsmax(Name), Auth, charsmax(Auth), dummy, 0, Access);
                
                if (equal(Auth, arg))
                {
                    if (Access & ADMIN_IMMUNITY)
                    {
                        console_print(id, "[AMXX] %s : %L", Auth, id, "CLIENT_IMM", Name);
                        
                        return PLUGIN_HANDLED;
                    }
                    // User did not have immunity
                    canban = true;
                }
            }
        }
        
        if (!canban)
        {
            console_print(id, "[AMXX] You may only ban recently disconnected clients.  Use ^"amx_last^" to view.");
            
            return PLUGIN_HANDLED;
        }
        
    }
*/
    // User has access to ban their target
    
if (contain(arg".") != -1)
    {
        
server_cmd("addip ^"%s^" ^"%s^";wait;writeip"minutesarg)
        
console_print(id"[AMXX] Ip ^"%s^" added to ban list"arg)
    } else {
        
//server_cmd("banid ^"%s^" ^"%s^";wait;writeid", minutes, arg) // Original code
        
server_cmd("banid %s %s;wait;writeid"minutesarg// 'Fix' for Steam Update
        
console_print(id"[AMXX] Authid ^"%s^" added to ban list"arg)
    }

    
get_user_name(idname31)

    
show_activity_key("ADMIN_ADDBAN_1""ADMIN_ADDBAN_2"namearg);

    
get_user_authid(idauthid31)
    
log_amx("Cmd: ^"%s<%d><%s><>^" ban ^"%s^" (minutes ^"%s^") (reason ^"%s^")"nameget_user_userid(id), authidargminutesreason)

    return 
PLUGIN_HANDLED

__________________
fysiks is offline
tomslayer
Junior Member
Join Date: Nov 2009
Old 12-20-2009 , 14:10   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #7

@fysiks

thanks a lot! and sorry for the late reply, better late than never
tomslayer is offline
numbster
Member
Join Date: Dec 2016
Old 05-09-2017 , 13:13   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #8

Sorry for my stupid question, but in which file need put this code?
numbster is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 05-09-2017 , 13:45   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #9

Ban Disconnected Player Menu v2.0.1
Quote:
Displays a menu that allows admins to ban recently disconnected players.
https://forums.alliedmods.net/showthread.php?p=475499

Last edited by 4ever16; 05-09-2017 at 14:34.
4ever16 is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 05-09-2017 , 13:51   Re: [REQ] Ban ip/steamid even if player not on server
Reply With Quote #10

Quote:
Originally Posted by numbster View Post
Sorry for my stupid question, but in which file need put this code?
admincmd.sma
__________________
JusTGo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:15.


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