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

[Any] Limit Ban Duration v1.0.2 (Updated: 4/23/12)


Post New Thread Reply   
 
Thread Tools Display Modes
fron
Junior Member
Join Date: Apr 2012
Location: Earth
Old 04-22-2012 , 02:07   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #11

For example, I put on a week bantime flag "z", then all of the above bans this time without a flag "z" will not permission?
fron is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 04-22-2012 , 11:35   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #12

It doesn't exactly work that way, although that may change in the future if I can find a logical way to do it.
When banning via sm_ban, the plugin only takes into consideration the upper/lower bounds for the space between two points. What I mean by that is if you ban for 7 minutes, the plugin wants to find the lower and upper bounds for that 7 minutes, so it'll choose "5" and "15" if you're using the default configuration. Since it has the upper bounds, it's just going to check permission for that one and see if you have it. If it fails, it'll consider going through the lower bounds and beyond if you have the reduce option enabled. "5" and "15" is considered a separate entry while "30" and "60" would be considered one. The plugin doesn't care about the higher entries once it finds the upper/lower bounds.

Now if you're banning via the ban menu in a modified basebans or sourcebans, the plugin is simply going to loop through all of the entries and see if you have permission for them. That means if you have the "b" flag, assign players with "b" access to "5", "15", "30", "10080", and "0", they'll have the ability to mute for 5/15/30 minutes, 1 week, or permanently.
__________________
thetwistedpanda is offline
fron
Junior Member
Join Date: Apr 2012
Location: Earth
Old 04-22-2012 , 12:20   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #13

Can be done on this type?
PHP Code:
if(bantime 10080 && !(CheckCommandAccess(client"sm_ban"ADMFLAG_BAN)))
{
    
ReplyToCommand(client"You don't have permissions to ban over a week!");
    return 
Plugin_Handled;

You can not ban more than 10080 minutes and including permanent.
And so the ban was superimposed on sm_menu, console and !ban chat command.
fron is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 04-22-2012 , 12:24   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #14

Simply make anything above a week "z" and you'll have the same effect.
__________________
thetwistedpanda is offline
fron
Junior Member
Join Date: Apr 2012
Location: Earth
Old 04-22-2012 , 13:01   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #15

And if you banned for a time that is not in the config file?
fron is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 04-22-2012 , 13:06   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #16

If you ban for less than any defined lengths, it will check permission for the first length. If you ban for greater than any defined lengths, it will check permission for the last length. Pending cvars, however, the plugin has the capability of lowering the ban length to the last defined length, so 30298742234 would turn into 4 weeks.
__________________
thetwistedpanda is offline
violentcrimes
Senior Member
Join Date: Nov 2006
Old 04-22-2012 , 20:30   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #17

I am having an issue with Permanent not showing up in the admin menu. I have given myself all the flags but yet I don't see it.

Quote:
"Limit_Ban_Durations"
{
//-=-=-=-=-=-=-=-=-=-=-=-=-=
//"#_of_minutes"
//{
// "override" "Limit_Ban_Duration"
// "flags" "flag1,flag2,flag3"
// "display" "X Minutes/Hours/Seconds/Years/Months/Jiggawatts"
//}
//-=-=-=-=-=-=-=-=-=-=-=-=-=
//- #_of_minutes is the maximum value for that rank. If you give an admin access to "5", they can ban up to 5 minutes, but no more.
//
//- "0" seconds indicates a permanent punishment. Only one "0" entry will be considered.
//
//- Both "override" and "flags" definitions are necessary when restricting a specific duration. Using one without the other will result in undesired behavior.
// - You're not required to use the "override" or even have Overrides set up on your server, but the definition is necessary for the method being used.
// - When in doubt, just use an override of "Limit_Ban_Duration". Set it and forget it the saying goes!
// - "flags" are checked when the user does not have access to the provided "override", so a bogus override allows for just flag usage.
// - When specifying multiple flags, users must possess all flags to access the specific duration.
// - For example, "flags" "a,b,c" will require the user possess all three flags.
//
//- An "override" and "flags" definition of "" will result in no restriction being placed upon that length.
// - Do not do silly things such as block off "5" minutes yet allow "15" minutes; the plugin will durations arrange times from low to high and assumes you're not an idiot.
//
//- The "display" parameter is displayed to clients when accessing the ban parameter is a modified ban plugin.
//-=-=-=-=-=-=-=-=-=-=-=-=-=

"5"
{
"override" "Limit_Ban_Duration"
"flags" "o"

"display" "5 Minutes"
}
"10"
{
"override" "Limit_Ban_Duration"
"flags" "o"

"display" "10 Minutes"
}
"15"
{
"override" "Limit_Ban_Duration"
"flags" "o"

"display" "15 Minutes"
}
"30"
{
"override" "Limit_Ban_Duration"
"flags" "o"

"display" "30 Minutes"
}
"45"
{
"override" "Limit_Ban_Duration"
"flags" "o"

"display" "45 Minutes"
}
"60"
{
"override" "Limit_Ban_Duration"
"flags" "o"

"display" "60 Minutes"
}
"120"
{
"override" "Limit_Ban_Duration"
"flags" "p"

"display" "2 Hours"
}
"180"
{
"override" "Limit_Ban_Duration"
"flags" "p"

"display" "3 Hours"
}
"360"
{
"override" "Limit_Ban_Duration"
"flags" "p"

"display" "6 Hours"
}
"720"
{
"override" "Limit_Ban_Duration"
"flags" "p"

"display" "12 Hours"
}
"1440"
{
"override" "Limit_Ban_Duration"
"flags" "p"

"display" "24 Hours"
}
"2880"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "2 Days"
}
"4320"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "3 Days"
}
"5760"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "4 Days"
}
"7200"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "5 Days"
}
"8640"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "6 Days"
}
"10080"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "7 Days"
}
"20160"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "2 Weeks"
}
"30240"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "3 Weeks"
}
"40320"
{
"override" "Limit_Ban_Duration"
"flags" "q"

"display" "4 Weeks"
}
"0"
{
"override" "Limit_Ban_Duration"
"flags" "r"

"display" "Permanent"
}
}
__________________
violentcrimes is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 04-22-2012 , 21:31   Re: [Any] Limit Ban Duration v1.0.1 (Updated: 4/21/12)
Reply With Quote #18

You sir found a bug, I didn't consider perma bans as they're coded differently. I'll fix it in the next update, probably be done Tuesday.
__________________
thetwistedpanda is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 04-23-2012 , 15:07   Re: [Any] Limit Ban Duration v1.0.2 (Updated: 4/23/12)
Reply With Quote #19

Revision 1.0.2
  • Added an option for -1 index parameter in natives, which will reference the perma ban entry.
  • Updated LBD_Basebans & LBD_Sourcebans to have support for perma ban options.
v1.0.1 --> v1.0.2
  • You'll need to update sm_limit_ban_duration.smx as well as either lbd_sourcebans.smx / lbd_basebans.smx.
__________________
thetwistedpanda is offline
C0nw0nk
Senior Member
Join Date: May 2011
Location: United Kingdom
Old 06-23-2012 , 18:44   Re: [Any] Limit Ban Duration v1.0.2 (Updated: 4/23/12)
Reply With Quote #20

Very nice twisted panda thanks so much this is the kind of stuff that should be included in sourcemod.
C0nw0nk is offline
Send a message via MSN to C0nw0nk
Reply


Thread Tools
Display Modes

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 11:58.


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