Difference between revisions of "Adding Admins (AMX Mod X)"

From AlliedModders Wiki
Jump to: navigation, search
 
 
(13 intermediate revisions by 6 users not shown)
Line 17: Line 17:
 
<pre>setinfo "_pw" "mypass"</pre>
 
<pre>setinfo "_pw" "mypass"</pre>
  
For information on what access levels mean, see [#Access Levels]].
+
For information on what access levels mean, see [[#Access Levels|Access Levels]].
  
{{qnotice|'''Note:''' It is important that you do not use the 'z' flag for admins.}}
+
{{qnotice|It is important that you do not use the 'z' flag for admins because that's the non-admin flag.}}
  
 
==Removing an Admin==
 
==Removing an Admin==
Line 26: Line 26:
  
 
That will prevent the entry from being read.
 
That will prevent the entry from being read.
 
+
{{LanguageSwitch}}
  
 
=Admins (SQL)=
 
=Admins (SQL)=
Line 32: Line 32:
  
 
==Configuring Server==
 
==Configuring Server==
First, make sure you have configured your server for SQL by reading [[Configuring AMX Mod X#SQL]].  Then, enable the admin_sql.amxx plugin instead of admin.amxx, by opening amxmodx/configs/plugins.ini.  You should change the first two entries to look something like this:
+
First, make sure you have configured your server for SQL by reading [[Configuring AMX Mod X#SQL|Configuring AMX Mod X: SQL]].  Then, enable the admin_sql.amxx plugin instead of admin.amxx, by opening amxmodx/configs/plugins.ini.  You should change the first two entries to look something like this:
 
<pre>;admin.amxx ; Disabled  
 
<pre>;admin.amxx ; Disabled  
 
admin_sql.amxx ; SQL admins</pre>
 
admin_sql.amxx ; SQL admins</pre>
Line 40: Line 40:
 
Once the server loads for the first time, it will automatically create the table specified with <tt>amx_sql_table</tt>.
 
Once the server loads for the first time, it will automatically create the table specified with <tt>amx_sql_table</tt>.
  
You can either add an admin through an SQL tool like an SQL Console or phpMyAdmin, or you can add an admin [[Adding Admins (AMX Mod X)#Through Console|using amx_addadmin]].   
+
You can either add an admin through an SQL tool like an SQL Console or phpMyAdmin, or you can add an admin [[Adding Admins (AMX Mod X)#Console Command|using amx_addadmin]].   
  
If you choose to use SQL directly (or an interface), you must learn the table layout.  There are four columns, each corresponding to one of the four properties listed above in [[#Adding an Admin]].  For example:
+
If you choose to use SQL directly (or an interface), you must learn the table layout.  There are four columns, each corresponding to one of the four properties listed above in [[#Adding an Admin|Adding an Admin]].  For example:
 
<pre>INSERT INTO admins VALUES("STEAM_0:1:23456", "", "abcdefghijklmnopqrstu", "ce");</pre>
 
<pre>INSERT INTO admins VALUES("STEAM_0:1:23456", "", "abcdefghijklmnopqrstu", "ce");</pre>
  
{{qnotice|'''Note:''' It is important that you do not use the 'z' flag for admins.}}
+
{{qnotice|It is important that you do not use the 'z' flag for admins.}}
  
 
For information on what access levels mean, see [[AMX Mod X Access Levels]].
 
For information on what access levels mean, see [[AMX Mod X Access Levels]].
 +
{{LanguageSwitch}}
 +
 +
=Console Command=
 +
 +
You can also use the console command amx_addadmin for adding admins.  It will work for both [[SQL]] and users.ini, depending on which plugin you have enabled.  An example of using the command in-game:
 +
<pre>amx_addadmin "BAILOPAN" "abcdefghijklmnopqrstu"</pre>
 +
Using the command from the server/[[rcon]] console:
 +
<pre>amx_addadmin "STEAM_0:1:23456" "abcdefghijklmnopqrstu"</pre>
 +
 +
=Access Levels=
 +
These access levels are the default access levels for the base [[AMX Mod X]] plugins.  3rd party plugins may have different usages for them, although in general users try to stick to the intentions for each flag.
 +
 +
:{|
 +
|- class="t2th"
 +
| Access Flag
 +
| Purpose
 +
|- class="t2td"
 +
| a
 +
| immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
 +
|- class="t2td"
 +
| b
 +
| reservation (can join on reserved slots)
 +
|- class="t2td"
 +
| c
 +
| amx_kick command
 +
|- class="t2td"
 +
| d
 +
| amx_ban and amx_unban commands
 +
|- class="t2td"
 +
| e
 +
| amx_slay and amx_slap commands
 +
|- class="t2td"
 +
| f
 +
| amx_map command
 +
|- class="t2td"
 +
| g
 +
| amx_cvar command (not all cvars will be available)
 +
|- class="t2td"
 +
| h
 +
| amx_cfg command
 +
|- class="t2td"
 +
| i
 +
| amx_chat and other chat commands
 +
|- class="t2td"
 +
| j
 +
| amx_vote and other vote commands
 +
|- class="t2td"
 +
| k
 +
| access to sv_password cvar (by amx_cvar command)
 +
|- class="t2td"
 +
| l
 +
| access to amx_rcon command and rcon_password cvar (by amx_cvar command)
 +
|- class="t2td"
 +
| m
 +
| custom level A (for additional plugins)
 +
|- class="t2td"
 +
| n
 +
| custom level B
 +
|- class="t2td"
 +
| o
 +
| custom level C
 +
|- class="t2td"
 +
| p
 +
| custom level D
 +
|- class="t2td"
 +
| q
 +
| custom level E
 +
|- class="t2td"
 +
| r
 +
| custom level F
 +
|- class="t2td"
 +
| s
 +
| custom level G
 +
|- class="t2td"
 +
| t
 +
| custom level H
 +
|- class="t2td"
 +
| u
 +
| menu access
 +
|- class="t2td"
 +
| z
 +
| user (no admin)
 +
|}
 +
 +
 +
=Connection Flags=
 +
These flags control how [[AMX Mod X]] attempts to authorize a connecting admin.
 +
 +
:{|
 +
|- class="t2th"
 +
| Connection Flag
 +
| Purpose
 +
|- class="t2td"
 +
| a
 +
| disconnect player on invalid password
 +
|- class="t2td"
 +
| b
 +
| clan tag
 +
|- class="t2td"
 +
| c
 +
| this is steamid/wonid
 +
|- class="t2td"
 +
| d
 +
| this is ip
 +
|- class="t2td"
 +
| e
 +
| password not checked (only name/ip/steamid needed)
 +
|}
 +
 +
[[Category:Documentation (AMX Mod X)]]

Latest revision as of 06:57, 26 February 2017

Admins (non-SQL)

Adding an Admin

First, open the amxmodx/configs/users.ini file with your favorite text editor. Scroll to the bottom. Admin entries are stored with four options: Authentication, Password, Access Right, Connection Properties.

In the early days of Half-Life 1 it was common to have admins authenticate by name. However, now it is recommended to auth by steamid. An example of a typical admin entry is:

"STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"

Entries are one-per-line, and each of the four options are space separated, contained in double-quotes. This one means:

  1. The user has SteamID STEAM_0:0:123456
  2. The user has no password (steamid-authentication)
  3. Access rights are levels a through u
  4. The user is a steamid ("c") and has no password ("e")

It is also possible to authenticate by username:

"BAILOPAN" "mypass" "abcdefghijklmnopqrstu" "a"

To authenticate, BAILOPAN would put this in his client's autoexec.cfg, where "_pw" is the value of "amx_password_field" in amxx.cfg.

setinfo "_pw" "mypass"

For information on what access levels mean, see Access Levels.

Note: It is important that you do not use the 'z' flag for admins because that's the non-admin flag.

Removing an Admin

Find the admin's entry in your amxmodx/configs/users.ini file, and put a semicolon in front of it. For example:

;"STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"

That will prevent the entry from being read.

Warning: This template (and by extension, language format) should not be used, any pages using it should be switched to Template:Languages

View this page in:  English  Russian  简体中文(Simplified Chinese)

Admins (SQL)

AMX Mod X lets you store admin accounts in a MySQL database. This is ideal if you have multiple servers with common administrators.

Configuring Server

First, make sure you have configured your server for SQL by reading Configuring AMX Mod X: SQL. Then, enable the admin_sql.amxx plugin instead of admin.amxx, by opening amxmodx/configs/plugins.ini. You should change the first two entries to look something like this:

;admin.amxx ; Disabled 
admin_sql.amxx ; SQL admins

Maintaining Admins

Once the server loads for the first time, it will automatically create the table specified with amx_sql_table.

You can either add an admin through an SQL tool like an SQL Console or phpMyAdmin, or you can add an admin using amx_addadmin.

If you choose to use SQL directly (or an interface), you must learn the table layout. There are four columns, each corresponding to one of the four properties listed above in Adding an Admin. For example:

INSERT INTO admins VALUES("STEAM_0:1:23456", "", "abcdefghijklmnopqrstu", "ce");

Note: It is important that you do not use the 'z' flag for admins.

For information on what access levels mean, see AMX Mod X Access Levels.

Warning: This template (and by extension, language format) should not be used, any pages using it should be switched to Template:Languages

View this page in:  English  Russian  简体中文(Simplified Chinese)

Console Command

You can also use the console command amx_addadmin for adding admins. It will work for both SQL and users.ini, depending on which plugin you have enabled. An example of using the command in-game:

amx_addadmin "BAILOPAN" "abcdefghijklmnopqrstu"

Using the command from the server/rcon console:

amx_addadmin "STEAM_0:1:23456" "abcdefghijklmnopqrstu"

Access Levels

These access levels are the default access levels for the base AMX Mod X plugins. 3rd party plugins may have different usages for them, although in general users try to stick to the intentions for each flag.

Access Flag Purpose
a immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
b reservation (can join on reserved slots)
c amx_kick command
d amx_ban and amx_unban commands
e amx_slay and amx_slap commands
f amx_map command
g amx_cvar command (not all cvars will be available)
h amx_cfg command
i amx_chat and other chat commands
j amx_vote and other vote commands
k access to sv_password cvar (by amx_cvar command)
l access to amx_rcon command and rcon_password cvar (by amx_cvar command)
m custom level A (for additional plugins)
n custom level B
o custom level C
p custom level D
q custom level E
r custom level F
s custom level G
t custom level H
u menu access
z user (no admin)


Connection Flags

These flags control how AMX Mod X attempts to authorize a connecting admin.

Connection Flag Purpose
a disconnect player on invalid password
b clan tag
c this is steamid/wonid
d this is ip
e password not checked (only name/ip/steamid needed)