Raised This Month: $95 Target: $400
 23% 

AMX_BAN replacement. for temp ban only


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   EKS (167)
jsauce
Senior Member
Join Date: Aug 2004
Location: Fitchburg, MA USA
Old 08-07-2005 , 17:55   AMX_BAN replacement. for temp ban only
Reply With Quote #1

Code:
/*
*
*  AMXX BAN Replacement v 1.0
*
*  The ban code itself was created by the AMXX Dev Team. This is just used as a replacement
*  for the normal ban, so an admin can impose a limit on bans from certain users.
*  I made the modification at the request of an admin friend who's server admins
*  tend to make bans permanent without thinking about it first. This will prevent that from
*  happening, by restricting the max length to whatever the admin sets amx_ban_temp cvar to. 	
*
*  This should be placed above your admincmd.amxx in your plugins.ini file.
*  You can change the access level for the temp ban, by modifying the define low_ban line.
*  It's currently set to ADMIN_LEVEL_E
*
*  A user who has both NORMAL_BAN and LOW_BAN will have it default to NORMAL_BAN which means they
*  can ban a user to any amount of time. A user with access only to LOW_BAN cannot.
*
*
*  The amx_ban_temp cvar is set to 1440 or 24 hours by default.
*
*/
Again there are two defined here:

#define NORMAL_BAN ADMIN_BAN
#define LOW_BAN ADMIN_LEVEL_E

So modify the LOW_BAN level to whatever admin level you like.
Attached Files
File Type: sma Get Plugin or Get Source (amx_ban2.sma - 2946 views - 4.3 KB)
__________________
"Those people who think they know everything are a great annoyance to those of us who do." -- Isaac Asimov

The Saucy Blog
jsauce is offline
Send a message via ICQ to jsauce Send a message via AIM to jsauce Send a message via MSN to jsauce
Coffin_Dancer
Junior Member
Join Date: Aug 2005
Old 08-18-2005 , 23:24   Please Help
Reply With Quote #2

I'm downloaded and installed the plugin but can't get it associate with the letter 'e' in the user.ini. I put it before the admincmd.amxx in the plugin.ini as well. And I know the plugin is running.

Any thoughts?

Thanks,
Coffin Dancer
Coffin_Dancer is offline
kILL-jOY
Member
Join Date: Jul 2005
Old 08-19-2005 , 00:14  
Reply With Quote #3

nice looks useful
kILL-jOY is offline
jsauce
Senior Member
Join Date: Aug 2004
Location: Fitchburg, MA USA
Old 08-19-2005 , 00:50   Re: Please Help
Reply With Quote #4

Quote:
Originally Posted by Coffin_Dancer
I'm downloaded and installed the plugin but can't get it associate with the letter 'e' in the user.ini. I put it before the admincmd.amxx in the plugin.ini as well. And I know the plugin is running.

Any thoughts?

Thanks,
Coffin Dancer
Yeah its not the flag e but rather ADMIN_LEVEL_E which is equal to the flag q as the flag e is equal to ADMIN_SLAY.

Code:
#define ADMIN_ALL		0	/* everyone */
#define ADMIN_IMMUNITY		(1<<0)	/* flag "a" */
#define ADMIN_RESERVATION	(1<<1)	/* flag "b" */
#define ADMIN_KICK		(1<<2)	/* flag "c" */
#define ADMIN_BAN		(1<<3)	/* flag "d" */
#define ADMIN_SLAY		(1<<4)	/* flag "e" */
#define ADMIN_MAP		(1<<5)	/* flag "f" */
#define ADMIN_CVAR		(1<<6)	/* flag "g" */
#define ADMIN_CFG		(1<<7)	/* flag "h" */
#define ADMIN_CHAT		(1<<8)	/* flag "i" */
#define ADMIN_VOTE		(1<<9)	/* flag "j" */
#define ADMIN_PASSWORD		(1<<10)	/* flag "k" */
#define ADMIN_RCON		(1<<11)	/* flag "l" */
#define ADMIN_LEVEL_A		(1<<12)	/* flag "m" */
#define ADMIN_LEVEL_B		(1<<13)	/* flag "n" */
#define ADMIN_LEVEL_C		(1<<14)	/* flag "o" */
#define ADMIN_LEVEL_D		(1<<15)	/* flag "p" */
#define ADMIN_LEVEL_E		(1<<16)	/* flag "q" */
#define ADMIN_LEVEL_F		(1<<17)	/* flag "r" */
#define ADMIN_LEVEL_G		(1<<18)	/* flag "s" */
#define ADMIN_LEVEL_H		(1<<19)	/* flag "t" */
#define ADMIN_MENU		(1<<20)	/* flag "u" */
#define ADMIN_ADMIN		(1<<24)	/* flag "y" */
#define ADMIN_USER		(1<<25)	/* flag "z" */
__________________
"Those people who think they know everything are a great annoyance to those of us who do." -- Isaac Asimov

The Saucy Blog
jsauce is offline
Send a message via ICQ to jsauce Send a message via AIM to jsauce Send a message via MSN to jsauce
Coffin_Dancer
Junior Member
Join Date: Aug 2005
Old 08-20-2005 , 01:06  
Reply With Quote #5

I've given these abilities in admin "cefgijmnopqrstu"

but they don't have any of the temp bans in amx_help or the adminmodmenu.

Any more thoughts? I know the plugin is running but they don't have that ability.

Thanks,
Coffin Dancer
Coffin_Dancer is offline
jsauce
Senior Member
Join Date: Aug 2004
Location: Fitchburg, MA USA
Old 08-20-2005 , 02:09  
Reply With Quote #6

Quote:
Originally Posted by Coffin_Dancer
I've given these abilities in admin "cefgijmnopqrstu"

but they don't have any of the temp bans in amx_help or the adminmodmenu.

Any more thoughts? I know the plugin is running but they don't have that ability.

Thanks,
Coffin Dancer
Okay the way it works is if the user has access flag q but not access flag d than they can do an amx_ban whatever and if that ban is either 0 meaning permanent or anything over 1440 minutes it will default to 1440 minutes. This will only work with the console it wont work with menu or however you are trying to do it. And I don't understand what you mean "they don't have any of the temp bans in the amx_help" I don't understand that. Explain further, I have tested this plugin thoroughly and its currently running on my server and the person's I wrote it for. I know that its working exactly as it was designed. Also if its not working make sure its above the admincmd.amxx line in your plugins.ini or it will do absolutely nothing.
__________________
"Those people who think they know everything are a great annoyance to those of us who do." -- Isaac Asimov

The Saucy Blog
jsauce is offline
Send a message via ICQ to jsauce Send a message via AIM to jsauce Send a message via MSN to jsauce
Coffin_Dancer
Junior Member
Join Date: Aug 2005
Old 08-21-2005 , 02:06  
Reply With Quote #7

Okay, what I meant by temp bans in the amx_help. When looking for the command in the amx_help in console, nothing is there.

I have it above the admincmd.amxx line.

I have the admin command "d" and can ban but the people who only have "q" can not.

And I didn't follow a thing about the 1440 and such.

I've never fully understood this program or how to make it run exactly the way I wanted/need it to.

I really appreciate your help.

Thanks,
Coffin Dancer
Coffin_Dancer is offline
jsauce
Senior Member
Join Date: Aug 2004
Location: Fitchburg, MA USA
Old 08-21-2005 , 02:14  
Reply With Quote #8

If a person with the flag q but not d attempts the command amx_ban whoever 99999 what happens? At the very least the user should receive a message saying, "You have insufficient access to use this command." in the console. If you're not even getting that then there is something wrong. If that's the case try changing the line:

register_concmd("amx_ban","cmdBan",ADMIN_ADMI N,"<name or #userid> <minutes> [reason]")

to

register_concmd("amx_ban","cmdBan",ADMIN_ALL, "<name or #userid> <minutes> [reason]")

Which will let everyone have access to it but because I have it checking flag by flag, if the user doesn't have either d or q then you will get that message.
__________________
"Those people who think they know everything are a great annoyance to those of us who do." -- Isaac Asimov

The Saucy Blog
jsauce is offline
Send a message via ICQ to jsauce Send a message via AIM to jsauce Send a message via MSN to jsauce
Coffin_Dancer
Junior Member
Join Date: Aug 2005
Old 08-25-2005 , 02:21  
Reply With Quote #9

Thank you. Apparently, they did have the command but it doesn't show up in the list of amx commands when doing amx_help. They can temp ban now.

Will those admins be able to do amx_ban 0 for a perma ban? And how long is amx_ban 1440?

Those are just secondary questions. Thank you for your help!
Coffin_Dancer is offline
jsauce
Senior Member
Join Date: Aug 2004
Location: Fitchburg, MA USA
Old 08-25-2005 , 02:58  
Reply With Quote #10

If an admin with that level attempts to set a ban for 0 or more than 1440 the plugin intercepts that and replaces it with 1440 minutes. 1440 minutes is 24 hours. So the admin could set a max of 24 hours ban, however they can set any normal ban lower than that. So what I mean is they can set a ban from 1-1440 minutes.
__________________
"Those people who think they know everything are a great annoyance to those of us who do." -- Isaac Asimov

The Saucy Blog
jsauce is offline
Send a message via ICQ to jsauce Send a message via AIM to jsauce Send a message via MSN to jsauce
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 01:56.


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