Raised This Month: $ Target: $400
 0% 

Super Admin - Override other admin's access when ur playing


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
kurian
Member
Join Date: Aug 2005
Old 06-03-2007 , 02:21   Super Admin - Override other admin's access when ur playing
Reply With Quote #1

* Super Admin Override feature
* coded by Torch a.k.a. Kurian Abraham.
*
* When an admin with the OVERRIDE access flag joins the server, all the other
* admin's powers are rendered useless. Only admins with the OVERRIDE flag
* can use the commands that require admin access flags like amx_kick, map, etc.
* When an ordinary admin tries to use an admin command while a Super Admin is on the server, "A Super Administrator is playing on the server. Access overridden."
* Ordinary admins will be able to access commands once all Super Admins
* have left the server.
*
* The default OVERRIDE access flag is set to ADMIN_RCON. This is ideal
* for obvious reasons. In this case "l" is the corresponding letter in users.ini
*
* This is a modified version of the default amxmisc.inc file that comes with AMX Mod X.
* To use this modification you must recompile all your plugins after replacing
* the default amxmisc.inc file with this one.
*
* Only commands that check access using the cmd_access() function are affected.
* Plugins that use get_user_flags() are not supported.
* You must modify such plugins to use cmd_access() instead.
*
* I find this really useful when there are many admins on my server and
* they all want to change the map. No more changing map when I'm around.
* *Heh heh heh*

Instructions
People seem to be having a hard time figuring out how to use this.
This is not a plugin. There is no SMA file.
This is a modified include file which is used by other plugins.

1. Download the attached amxmisc.inc

2. Copy it to the amxmodx\scripting\include folder overwriting the old one.

3. Open up AMXX Studio.

4. In options set the Output path to "<mod dir>\addons\amxmodx\plugins". For example "E:\Program Files\CS\cstrike\addons\amxmodx\plugins". This will make it place the compiled plugins directly in the plugins folder so you need not manually copy the compiled plugins to the plugins folder.

5. Open up all the SMA's in the scripting folder one by one and click Compile.
These are the default SMA's that come with AMX Mod X which need recompiling.
admin.sma
adminchat.sma
admincmd.sma
adminvote.sma
cmdmenu.sma
mapsmenu.sma
menufront.sma
multilingual.sma
pausecfg.sma
plmenu.sma
restmenu.sma
statscfg.sma
statsx.sma
telemenu.sma

You should do this for any additional plugins you have installed. So you will have to download the SMA's from their respective forums and recompile them.

6. If you have setup the Output path properly, the recompiled plugins should already be in your plugins folder and ready for action. If you have a rented server then just upload the new plugins as you would normally do.

7. Now you must edit the users.ini file to assign Super Admins.
"Torch" "password" "abcdefghijklmnopqrstu" "a" <-- add "l" in access flags for Super Admin.
"Jonny" "password" "abcdefghijkmnopqrstu" "a" <-- no "l" means ordinary admin.

Jonny cannot use his powers while Torch is playing on the server.

Update June 05
Added a CVAR amx_override_spec.
If set to 0 then regular admins can access commands if all the Super Admins are in spectator.
If set to 1 then regular admins cannot access commands at all if a Super Admin is on the server.

Non Counter-Strike mod users should modify the team check. In the switch case, replace the 'T' and 'C' with the first letter of the teams in your mod.

Update November 05
It is now compatible with AMX Mod X v1.80. This is NOT backward compatible with previous versions.

Update April 12
Made the CVAR amx_override_spec as Static and changed the way it checks if its already registered. This *should* fix any problems people are having with the CVAR. Note that its CVAR so you can only change it through RCON on a dedicated server, or in a Listenserver it can be typed in the console.

Recompile ALL plugins with the new version, including AMXX default plugins. Any plugins that were compiled with the old version MUST be recompiled or removed, else they will interfere with the new version.
Attached Files
File Type: inc Amxmisc(1.76).inc (9.2 KB, 268 views)
File Type: inc amxmisc.inc (16.6 KB, 300 views)
__________________
[IMG]http://img267.**************/img267/8526/userbarjg9.gif[/IMG]

Last edited by kurian; 04-12-2008 at 04:05. Reason: Added instructions
kurian is offline
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-04-2007 , 03:40   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #2

Hi there good work! But it seems a lot of work that you might spare us if you could post the smas with the include in it to us the lazy people. Add a zip with all the plugins in it already prepared. Or for safety reasons ask sanwce or Bail to to this version just in case. and to post it here. Thanks!
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
kurian
Member
Join Date: Aug 2005
Old 06-04-2007 , 10:26   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #3

Quote:
Originally Posted by Juba_PornBorn View Post
Hi there good work! But it seems a lot of work that you might spare us if you could post the smas with the include in it to us the lazy people. Add a zip with all the plugins in it already prepared. Or for safety reasons ask sanwce or Bail to to this version just in case. and to post it here. Thanks!
Read the edited main post...
__________________
[IMG]http://img267.**************/img267/8526/userbarjg9.gif[/IMG]
kurian is offline
ExKiLL
Senior Member
Join Date: Nov 2005
Location: Germany
Old 06-04-2007 , 12:32   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #4

sounds good

but where is the sma?
__________________
193.192.59.43:27015 ----- italy ( 20 )
85.25.150.62:27015 ------ sHclachthaus ( 14 )
85.25.150.62:27055 ------ DeathMatch ( 20 )
85.25.150.62:27035 ------ Kreedz Hangout ( 18 )
85.214.100.160:27015 ---- 24/7 full house | **GG + DM** ( 32 )
93.190.64.150:27015 ----- Superhero (12)
ExKiLL is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-04-2007 , 12:33   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #5

Quote:
Originally Posted by ExKiLL View Post
sounds good

but where is the sma?
Read the main post

Quote:
Oh I forgot to mention. This is not a new include. I have just slightly modified the existing amxmisc.inc
that comes with AMX Mod X. Any plugin that uses cmd_access() to check for required rights already has this
include. So all you have to do is just open up your sma's in AMXX Studio and hit Compile! Then copy over the new
plugin to your mod's plugins folder. This file is from AMX Mod X version 1.76d. It may be changed in future versions
so I'll have to re-edit it then.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
glasspipe
New Member
Join Date: Jan 2007
Old 06-04-2007 , 23:00   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #6

I like this idea but what happens if a "super admin" is in specing/afk, can the regular admins sitll do stuff like change map?
glasspipe is offline
kurian
Member
Join Date: Aug 2005
Old 06-04-2007 , 23:24   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #7

Quote:
Originally Posted by glasspipe View Post
I like this idea but what happens if a "super admin" is in specing/afk, can the regular admins sitll do stuff like change map?
Good idea..I'll add a CVAR so that you can allow regular admin's to access commands if all the Super Admins are in spectator.
__________________
[IMG]http://img267.**************/img267/8526/userbarjg9.gif[/IMG]
kurian is offline
kurian
Member
Join Date: Aug 2005
Old 06-05-2007 , 00:46   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #8

I have a question. I want to add a CVAR amx_override_spec.
If its set to 0 then regular admins will be able to access commands if all the Super Admins are in Spectator. If its set to 1 then regular admins cannot access commands at all if a Super Admin is on the server in any team or spec.

I have coded the logic in the cmd_access function, but i cant register the CVAR! Since its an include file, global variables are not allowed! The only solution i can think of is to write a plugin just for the sake of registering the CVAR. And it must be the VERY FIRST entry in plugins.ini so that the CVAR will be registered before any other plugin can try to read it.
__________________
[IMG]http://img267.**************/img267/8526/userbarjg9.gif[/IMG]

Last edited by kurian; 06-05-2007 at 00:50.
kurian is offline
kurian
Member
Join Date: Aug 2005
Old 06-05-2007 , 01:55   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #9

OK I just added a check to see if the CVAR already exists. Get_cvar_pointer returns 0 if the CVAR doesnt exist. If it doesnt then the CVAR is registered.
Although this check is performed everytime as its not possible any other way in an include file, I dont think its going to pose an efficiency problem as its only going to be executed when an admin types a command. Which doesnt happed every frame or something
__________________
[IMG]http://img267.**************/img267/8526/userbarjg9.gif[/IMG]
kurian is offline
iggy_bus
BANNED
Join Date: Oct 2005
Old 06-19-2007 , 09:36   Re: Super Admin - Override other admin's access when ur playing
Reply With Quote #10

Installed this, works.

Verry usefull for adding some mini admins who are not supposed to have amx powers while there are real admins on the server.


GJ man ! ;)
iggy_bus 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 20:34.


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