Difference between revisions of "Adding Admins (SourceMod)"

From AlliedModders Wiki
Jump to: navigation, search
m (Levels)
m (updated for new immunity rules)
Line 79: Line 79:
  
 
=Immunity=
 
=Immunity=
There is no immunity flag.  Instead, there are three types of immunity:
+
In SourceMod, immunity is a flexible system based on ''immunity levels''.  Every admin can have an arbitrary immunity value assigned to them.  Whether an admin can target another admin depends on who has a higher immunity value.
*''Default'' immunity; immunity from admins who do not have default immunity.
+
 
*''Global'' immunity; immunity from admins who do not have global or default immunity.
+
For example, say Admin #1 has an immunity level of "3" and Admin #2 has an immunity level of "10."  Admin #2 can target Admin #1, but Admin #1 cannot target Admin #2.  The numbers are completely arbitrary, and they can be any number equal to or higher than 0.  Note that 0 always implies no immunity.
*''Specific'' immunity; immunity from a specific group (see advanced section).
+
 
 +
By default, admins with the same immunity value can target each other.  This can be changed via <tt>sm_immunity_mode</tt> in <tt>cfg/sourcemod.cfg</tt>.
  
 
=Simple Admins=
 
=Simple Admins=
The easiest way to add administrators is through <tt>configs/admins_simple.ini</tt>.  This is a flat file which requires two parameters per line: authentication info, and flags.   
+
The easiest way to add administrators is through <tt>configs/admins_simple.ini</tt>.  This is a flat file which requires two parameters per line: authentication info, and flags.  The flag string is somewhat flexible and can have the following information:
 +
*An optional immunity level value, followed by a colon (':');
 +
*A flag string, '''or''';
 +
*A group name, preceded by an '@' symbol
  
 
Three examples are provided:
 
Three examples are provided:
 
<pre>
 
<pre>
"STEAM_0:1:16" "bce" //kick, ban, slay for this steam ID
+
"STEAM_0:1:16" "bce" //kick, ban, slay for this steam ID.  no immunity
"!127.0.0.1" "z" //all permissions for this ip
+
"!127.0.0.1" "5:z" //all permissions for this ip, immunity level = 5
 
"BAILOPAN" "abc" "Gab3n" //name BAILOPAN, password "Gab3n": gets reservation, kick, ban
 
"BAILOPAN" "abc" "Gab3n" //name BAILOPAN, password "Gab3n": gets reservation, kick, ban
 
</pre>
 
</pre>

Revision as of 09:28, 10 September 2007

SourceMod has as very detailed and flexible administration system, and it can be quite daunting to users. To simplify things, there are a number of "flags" which specify generic permissions administrators can have.

Aside from that, there are (currently) two provided ways of storing admins. One via a simplified flat file, and another via a more complex tree-based file.

SourceMod provides three methods of authentication by default:

  • Steam ID (unique to a Steam account)
  • IP Address (semi-unique to a given computer, better for LANs)
  • Name (requires a password)

Levels

First, let's quickly run down the provided levels:

Name Flag Purpose
reservation a Reserved slot access.
generic b Generic admin; required for admins.
kick c Kick other players.
ban d Ban other players.
unban e Remove bans.
slay f Slay/harm other players.
map g Change the map or major gameplay features.
cvar h Change most cvars.
config i Execute config files.
chat j Special chat privileges.
vote k Start or create votes.
password l Set a password on the server.
rcon m Use RCON commands.
cheats n Change sv_cheats or use cheating commands.
root z Magically enables all flags.

Immunity

In SourceMod, immunity is a flexible system based on immunity levels. Every admin can have an arbitrary immunity value assigned to them. Whether an admin can target another admin depends on who has a higher immunity value.

For example, say Admin #1 has an immunity level of "3" and Admin #2 has an immunity level of "10." Admin #2 can target Admin #1, but Admin #1 cannot target Admin #2. The numbers are completely arbitrary, and they can be any number equal to or higher than 0. Note that 0 always implies no immunity.

By default, admins with the same immunity value can target each other. This can be changed via sm_immunity_mode in cfg/sourcemod.cfg.

Simple Admins

The easiest way to add administrators is through configs/admins_simple.ini. This is a flat file which requires two parameters per line: authentication info, and flags. The flag string is somewhat flexible and can have the following information:

  • An optional immunity level value, followed by a colon (':');
  • A flag string, or;
  • A group name, preceded by an '@' symbol

Three examples are provided:

"STEAM_0:1:16"		"bce"			//kick, ban, slay for this steam ID.  no immunity
"!127.0.0.1"		"5:z"			//all permissions for this ip, immunity level = 5
"BAILOPAN"		"abc"	"Gab3n"		//name BAILOPAN, password "Gab3n": gets reservation, kick, ban

Passwords

For passwords to work, the server administrator must change the "PassInfoVar" line in addons/sourcemod/configs/core.cfg. For example:

"PassInfoVar"			"_sm1337"

Next, if an admin has a password, he or she must set the password via the setinfo command in the client console. For example, using the examples above, BAILOPAN would need to type:

setinfo "_sm1337" "Gab3n"

To automate this upon connecting to a server, you can create an "autoexec.cfg" file in your client cstrike folder. This will be located under SteamApps\ACCOUNT\Counter-Strike Source\cstrike\cfg. For example:

  • C:\program files\steam\steamapps\bailopan\counter-strike source\cstrike\cfg

You can also set the password upon connecting. For steam and IP authentication, your admin privileges will be automatically assigned if the password is correct. For name based authentication, your password must be correct before you change your name, or else you will be kicked from the server.