AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic (https://forums.alliedmods.net/forumdisplay.php?f=15)
-   -   [HELP] Block permanent ban (https://forums.alliedmods.net/showthread.php?t=249703)

Colex 10-10-2014 12:21

[HELP] Block permanent ban
 
How to block permanent ban on amxmodx?

Allow only ban with times.

Sreaper 10-10-2014 14:02

Re: [HELP] Block permanent ban
 
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.

fysiks 10-10-2014 15:04

Re: [HELP] Block permanent ban
 
Quote:

Originally Posted by Sreaper (Post 2209497)
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.

Colex 10-10-2014 15:31

Re: [HELP] Block permanent ban
 
I want to remove permanent ban from the server.
Allow only bans per minute.

fysiks 10-10-2014 15:42

Re: [HELP] Block permanent ban
 
What commands do you need to be restricted?

Colex 10-10-2014 16:29

Re: [HELP] Block permanent ban
 
amx_ban = 0 (permanent)

fysiks 10-10-2014 18:42

Re: [HELP] Block permanent ban
 
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.

Colex 10-10-2014 20:26

Re: [HELP] Block permanent ban
 
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



fysiks 10-10-2014 21:18

Re: [HELP] Block permanent ban
 
Were you able to get it to compile? Are you sure you replaced the original .amxx file on your server (and restarted)?

Colex 10-11-2014 10:31

Re: [HELP] Block permanent ban
 
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




All times are GMT -4. The time now is 19:28.

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