Raised This Month: $ Target: $400
 0% 

[HELP] Block permanent ban


Post New Thread Reply   
 
Thread Tools Display Modes
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 10-11-2014 , 10:40   Re: [HELP] Block permanent ban
Reply With Quote #11

Try this
Code:
public cmdBan(id, level, cid) {     if (!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED     new target[32], minutes[8], reason[64]           read_argv(1, target, 31)     read_argv(2, minutes, 7)     read_argv(3, reason, 63)           new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)           if (!player)         return PLUGIN_HANDLED             new nNum = str_to_num(minutes)     if(!nNum)     {         client_print(id, print_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(player, authid2, 31)     get_user_authid(id, authid, 31)     get_user_name(player, name2, 31)     get_user_name(id, name, 31)           log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)           new temp[64], banned[16]     if (nNum)         format(temp, 63, "%L", player, "FOR_MIN", minutes)     else         format(temp, 63, "%L", player, "PERM")     format(banned, 15, "%L", player, "BANNED")     if (reason[0])         server_cmd("kick #%d ^"%s (%s %s)^";wait;banid %s %s;wait;writeid", userid2, reason, banned, temp, minutes, authid2)     else         server_cmd("kick #%d ^"%s %s^";wait;banid %s %s;wait;writeid", userid2, banned, temp, minutes, authid2)           // Display the message to all clients     new msg[256];     new len;     new maxpl = get_maxplayers();     for (new i = 1; i <= maxpl; i++)     {         if (is_user_connected(i) && !is_user_bot(i))         {             len = formatex(msg, charsmax(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(i, id, name, msg);         }     }           console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)           return PLUGIN_HANDLED }
__________________
Kia is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-11-2014 , 11:46   Re: [HELP] Block permanent ban
Reply With Quote #12

Quote:
Originally Posted by Colex View Post
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

You told me you wanted it for amx_ban, that's what I gave you. I did not give you anything for the ban menu. You can change the available settings for the ban menu in amxx.cfg.

@Kia, that's the same thing except you create a useless variable.
__________________

Last edited by fysiks; 10-11-2014 at 11:49.
fysiks is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 10-11-2014 , 14:08   Re: [HELP] Block permanent ban
Reply With Quote #13

Since you use it twice, why not making a variable.
Maybe the server falls for the placebo effect.
__________________
Kia is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-11-2014 , 14:23   Re: [HELP] Block permanent ban
Reply With Quote #14

Quote:
Originally Posted by Kia View Post
Since you use it twice, why not making a variable.
Maybe the server falls for the placebo effect.
I didn't realize it was used elsewhere. The last time that I studied that command, I noticed that it uses the actual string for the actual ban command. Also, I was trying to make it easy for someone to insert code without needing to modify anything else.
__________________

Last edited by fysiks; 10-11-2014 at 14:24.
fysiks is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 10-13-2014 , 02:41   Re: [HELP] Block permanent ban
Reply With Quote #15

just use advanced bans by exolent
you can set per-flag ban limits

I set it up for 5 admin ranks
4 hours
24 hours
1 week
permanent
permanent

but you can have it as whatever
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever 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 18:07.


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