Raised This Month: $51 Target: $400
 12% 

[HELP] Block permanent ban


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Colex
Senior Member
Join Date: Feb 2014
Old 10-10-2014 , 12:21   [HELP] Block permanent ban
Reply With Quote #1

How to block permanent ban on amxmodx?

Allow only ban with times.
Colex is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 10-10-2014 , 14:02   Re: [HELP] Block permanent ban
Reply With Quote #2

So they can do 999999999999999 for a duration instead? You would be better off having a separate ban command that has a fixed duration set.
Sreaper is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-10-2014 , 15:04   Re: [HELP] Block permanent ban
Reply With Quote #3

Quote:
Originally Posted by Sreaper View Post
So they can do 999999999999999 for a duration instead? You would be better off having a separate ban command that has a fixed duration set.
That ban will only be active while the server is running. As soon as the server stops or crashes, it will be removed.
__________________
fysiks is offline
Colex
Senior Member
Join Date: Feb 2014
Old 10-10-2014 , 15:31   Re: [HELP] Block permanent ban
Reply With Quote #4

I want to remove permanent ban from the server.
Allow only bans per minute.
Colex is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-10-2014 , 15:42   Re: [HELP] Block permanent ban
Reply With Quote #5

What commands do you need to be restricted?
__________________
fysiks is offline
Colex
Senior Member
Join Date: Feb 2014
Old 10-10-2014 , 16:29   Re: [HELP] Block permanent ban
Reply With Quote #6

amx_ban = 0 (permanent)
Colex is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-10-2014 , 18:42   Re: [HELP] Block permanent ban
Reply With Quote #7

To block people from using amx_ban for a permanent ban, you should add this:

Code:
	if( str_to_num(minutes) == 0 )
	{
		client_print(id, print_chat, "You cannot ban permanently.");
		return PLUGIN_HANDLED
	}
after this

Code:
	if (!player)
		return PLUGIN_HANDLED
in under "public cmdBan(id, level, cid)" in admincmd.sma, then recompile and upload the new .amxx file to your server.
__________________

Last edited by fysiks; 10-10-2014 at 18:43.
fysiks is offline
Colex
Senior Member
Join Date: Feb 2014
Old 10-10-2014 , 20:26   Re: [HELP] Block permanent ban
Reply With Quote #8

Not work....

PHP Code:
public cmdBan(idlevelcid)
{
    if (!
cmd_access(idlevelcid3))
        return 
PLUGIN_HANDLED

    
new target[32], minutes[8], reason[64]
    
    
read_argv(1target31)
    
read_argv(2minutes7)
    
read_argv(3reason63)
    
    new 
player cmd_target(idtargetCMDTARGET_OBEY_IMMUNITY CMDTARGET_NO_BOTS CMDTARGET_ALLOW_SELF)
    
    if (!
player)
        return 
PLUGIN_HANDLED
        
    
if( str_to_num(minutes) == )
    {
        
client_print(idprint_chat"Ban permanente, bloqueado!");
        return 
PLUGIN_HANDLED
    
}

    new 
authid[32], name2[32], authid2[32], name[32]
    new 
userid2 get_user_userid(player)

    
get_user_authid(playerauthid231)
    
get_user_authid(idauthid31)
    
get_user_name(playername231)
    
get_user_name(idname31)
    
    
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")"nameget_user_userid(id), authidname2userid2authid2minutesreason)
    
    new 
temp[64], banned[16], nNum str_to_num(minutes)
    if (
nNum)
        
format(temp63"%L"player"FOR_MIN"minutes)
    else
        
format(temp63"%L"player"PERM")

    
format(banned15"%L"player"BANNED")

    if (
reason[0])
        
server_cmd("kick #%d ^"%(%%s)^";wait;banid %s %s;wait;writeid"userid2reasonbannedtempminutesauthid2)
    else
        
server_cmd("kick #%d ^"%%s^";wait;banid %s %s;wait;writeid"userid2bannedtempminutesauthid2)

    
    
// Display the message to all clients

    
new msg[256];
    new 
len;
    new 
maxpl get_maxplayers();
    for (new 
1<= maxpli++)
    {
        if (
is_user_connected(i) && !is_user_bot(i))
        {
            
len formatex(msgcharsmax(msg), "%L"i"BAN");
            
len += formatex(msg[len], charsmax(msg) - len" %s "name2);
            if (
nNum)
            {
                
len += formatex(msg[len], charsmax(msg) - len"%L"i"FOR_MIN"minutes);
            }
            else
            {
                
len += formatex(msg[len], charsmax(msg) - len"%L"i"PERM");
            }
            if (
strlen(reason) > 0)
            {
                
formatex(msg[len], charsmax(msg) - len" (%L: %s)"i"REASON"reason);
            }
            
show_activity_id(iidnamemsg);
        }
    }
    
    
console_print(id"[AMXX] %L"id"CLIENT_BANNED"name2)
    
    return 
PLUGIN_HANDLED


Last edited by Colex; 10-10-2014 at 20:27.
Colex is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-10-2014 , 21:18   Re: [HELP] Block permanent ban
Reply With Quote #9

Were you able to get it to compile? Are you sure you replaced the original .amxx file on your server (and restarted)?
__________________
fysiks is offline
Colex
Senior Member
Join Date: Feb 2014
Old 10-11-2014 , 10:31   Re: [HELP] Block permanent ban
Reply With Quote #10

Yes, but it still did not work.

I tried the ban on amxmodmenu.

i got:

In actionBanMenu (plmenu.sma)

after:

PHP Code:
new userid2 get_user_userid(player
put:

PHP Code:
if( str_to_num(g_menuSettings[id]) == )
{
    
client_print(idprint_chat"You cannot ban permanently.");
    return 
PLUGIN_HANDLED


Last edited by Colex; 10-11-2014 at 11:30. Reason: In actionBanMenu (plmenu.sma)
Colex 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 00:25.


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