<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=HiJacker</id>
	<title>AlliedModders Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=HiJacker"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/Special:Contributions/HiJacker"/>
	<updated>2026-04-29T18:53:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=SQL_Admins_(SourceMod)&amp;diff=6150</id>
		<title>SQL Admins (SourceMod)</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=SQL_Admins_(SourceMod)&amp;diff=6150"/>
		<updated>2008-09-13T08:41:03Z</updated>

		<summary type="html">&lt;p&gt;HiJacker: /* Management Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SourceMod has support for loading and managing admins via SQL, using any of the supported SQL drivers provided (currently, MySQL and SQLite).  This can be very advantageous if you have a large number of admins, you wish to manage your admins via external tools, or you wish to share admins across servers.  &lt;br /&gt;
&lt;br /&gt;
This article will explain how to set up your server to use admins through SQL.  No knowledge of SQL is required for basic administration; however, by using this feature you should realize that SourceMod does not provide easy functionality for full SQL control.  You will need to use a third party tool or learn SQL yourself if you need greater functionality.&lt;br /&gt;
&lt;br /&gt;
However, it is assumed that you:&lt;br /&gt;
*Have access to an SQL database;&lt;br /&gt;
*Know how to access the SQL database;&lt;br /&gt;
*Know how to execute commands or scripts on the SQL database.&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
==MySQL==&lt;br /&gt;
Open &amp;lt;tt&amp;gt;configs/databases.cfg&amp;lt;/tt&amp;gt; on your server.  You should see a section called &amp;lt;tt&amp;gt;&amp;quot;default&amp;quot;&amp;lt;/tt&amp;gt;.  You can either use this section, or create a new one called &amp;lt;tt&amp;gt;&amp;quot;admins&amp;quot;&amp;lt;/tt&amp;gt; if you wish to separate your connections.  You must fill out the &amp;lt;tt&amp;gt;driver&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;host&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;database&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;user&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;pass&amp;lt;/tt&amp;gt; fields.  If you do not need a field, use empty quotation marks as the value (&amp;lt;tt&amp;gt;&amp;quot;&amp;quot;&amp;lt;/tt&amp;gt;).  &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	&amp;quot;default&amp;quot;&lt;br /&gt;
	{&lt;br /&gt;
		&amp;quot;driver&amp;quot;			&amp;quot;mysql&amp;quot;&lt;br /&gt;
		&amp;quot;host&amp;quot;				&amp;quot;localhost&amp;quot;&lt;br /&gt;
		&amp;quot;database&amp;quot;			&amp;quot;sourcemod&amp;quot;&lt;br /&gt;
		&amp;quot;user&amp;quot;				&amp;quot;myaccount&amp;quot;&lt;br /&gt;
		&amp;quot;pass&amp;quot;				&amp;quot;mypassword&amp;quot;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SQLite==&lt;br /&gt;
Add a section to your server's &amp;lt;tt&amp;gt;configs/databases.cfg&amp;lt;/tt&amp;gt; file as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	&amp;quot;admins&amp;quot;&lt;br /&gt;
	{&lt;br /&gt;
		&amp;quot;driver&amp;quot;			&amp;quot;sqlite&amp;quot;&lt;br /&gt;
		&amp;quot;database&amp;quot;			&amp;quot;admins-sqlite&amp;quot;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may choose to name the database any valid file name.  We chose &amp;quot;admins-sqlite&amp;quot; because a pre-made database, &amp;quot;admins-sqlite.sq3&amp;quot; is available in &amp;lt;tt&amp;gt;configs/sql-init-scripts/sqlite&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Database Setup=&lt;br /&gt;
==Automatic==&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt; is loaded, and then run the &amp;lt;tt&amp;gt;sm_create_adm_tables&amp;lt;/tt&amp;gt; command from your '''server console'''.  If using MySQL, you must have &amp;lt;tt&amp;gt;CREATE&amp;lt;/tt&amp;gt; permissions on your database.&lt;br /&gt;
&lt;br /&gt;
==Manual==&lt;br /&gt;
===MySQL===&lt;br /&gt;
If you have not already created a database on your MySQL server, do so.  &lt;br /&gt;
&lt;br /&gt;
Find the script &amp;lt;tt&amp;gt;configs/sql-init-scripts/mysql/create_admins.sql&amp;lt;/tt&amp;gt; in the SourceMod distribution.  Then, using either the command line or a tool such as [http://www.phpmyadmin.net/ phpMyAdmin], run its contents.  This will create the necessary tables.&lt;br /&gt;
&lt;br /&gt;
===SQLite===&lt;br /&gt;
SourceMod distributes a pre-made SQLite database file with all of the admin tables created.  If you wish to manually create a database or add tables to a pre-existing database, use the contents of the &amp;lt;tt&amp;gt;configs/sql-init-scripts/sqlite/create_admins.sql&amp;lt;/tt&amp;gt; script.&lt;br /&gt;
&lt;br /&gt;
Copy the &amp;lt;tt&amp;gt;configs/sql-init-scripts/sqlite/admins-sqlite.sq3&amp;lt;/tt&amp;gt; binary from the SourceMod distribution into your server's &amp;lt;tt&amp;gt;data/sqlite&amp;lt;/tt&amp;gt; folder.  If you chose to rename the database in &amp;lt;tt&amp;gt;databases.cfg&amp;lt;/tt&amp;gt;, you should rename this file as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Enabling Plugins=&lt;br /&gt;
By default, all of the SQL plugins are located in the &amp;lt;tt&amp;gt;plugins/disabled&amp;lt;/tt&amp;gt; folder on your server -- they are not loaded by default.  To enable plugins, move them from the &amp;lt;tt&amp;gt;plugins/disabled&amp;lt;/tt&amp;gt; folder and into &amp;lt;tt&amp;gt;plugins&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You will usually want to enable &amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt;.  This plugin adds some helpful console commands for very basic admin management.  However, you should only enable '''ONE''' of the other two SQL plugins:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;admin-sql-prefetch.smx&amp;lt;/tt&amp;gt;: This plugin is ideal for small to medium sized databases without much connection lag.  It loads the entire database admin contents at map load (or whenever a refresh is requested).  If you have serious database delay or want to be able to add/delete/edit admins without refreshing the per-map cache on each server,  this isn't the plugin for you.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;PROS:&amp;lt;/b&amp;gt; Very simple plugin with no extra complexity.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;CONS:&amp;lt;/b&amp;gt; Gameserver will stall whenever the cache is refreshed (mapload or when using &amp;lt;tt&amp;gt;sm_reloadadmins&amp;lt;/tt&amp;gt;).  If you add, remove, or edit admins, the changes are not reflected until the cache is refreshed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;tt&amp;gt;admin-sql-threaded.smx&amp;lt;/tt&amp;gt;: This plugin is completely threaded.  This makes it much more complex, and thus it is currently &amp;quot;experimental&amp;quot; (although it has been tested to work fine).  It pre-caches all group and override information.  Admin-lookup is done completely dynamically.&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;PROS:&amp;lt;/b&amp;gt; A faulty/slow database connection will never halt the server.  If you add/remove/edit admins, the changes will be reflected as soon as the player connects to the server.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;CONS:&amp;lt;/b&amp;gt; It is very complex and thus not trivial to edit for custom changes.  It also may have unexpected functionality (for example, &amp;lt;tt&amp;gt;sm_reloadadmins&amp;lt;/tt&amp;gt; will have a slight delayed reaction because the plugin is multi-threaded).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you have enabled the manager, and enabled &amp;lt;b&amp;gt;ONE&amp;lt;/b&amp;gt; of the &amp;lt;tt&amp;gt;admin-sql&amp;lt;/tt&amp;gt; plugins, you are ready to go!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Updating Tables=&lt;br /&gt;
==Automatic==&lt;br /&gt;
Make sure &amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt; is loaded, and run &amp;lt;tt&amp;gt;sm_update_adm_tables&amp;lt;/tt&amp;gt; from your server console.  If using MySQL, you must have &amp;lt;tt&amp;gt;CREATE&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ALTER&amp;lt;/tt&amp;gt; permissions for the database.&lt;br /&gt;
&lt;br /&gt;
==Manual==&lt;br /&gt;
If you are using an older version of the SourceMod table layouts, it is important to update the table layout for the latest schema. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;In summary&amp;lt;/b&amp;gt;:&lt;br /&gt;
*Back up all of your data.&lt;br /&gt;
*Find what revision your tables were created against.  Unfortunately the only way to do this right now is by remembering the version you used.&lt;br /&gt;
*Find all of the &amp;lt;tt&amp;gt;update_admins-rXXXX&amp;lt;/tt&amp;gt; scripts in your driver's folder, where &amp;lt;tt&amp;gt;XXXX&amp;lt;/tt&amp;gt; is higher than the version from the second step, and &amp;lt;tt&amp;gt;XXXX&amp;lt;/tt&amp;gt; is lower than or equal to the current version you're using.&lt;br /&gt;
*Execute each matching script in order of increasing revision number (lowest first, highest last).&lt;br /&gt;
*Upgrade the SQL plugin you use, and any 3rd party software that relies on the admin tables.&lt;br /&gt;
&lt;br /&gt;
Scripts for updating table structures are in &amp;lt;tt&amp;gt;configs/sql-init-scripts/&amp;amp;lt;driver&amp;amp;gt;/update_admins-rXXXX&amp;lt;/tt&amp;gt;, where XXXX is the revision number.  &lt;br /&gt;
&lt;br /&gt;
A potential scenario is provided below (&amp;lt;b&amp;gt;it is 100% fabricated; actual revision numbers are entirely different&amp;lt;/b&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
Your tables were created with SourceMod r2978.  The current version is 3512.  Say the following files might exist:&lt;br /&gt;
*&amp;lt;tt&amp;gt;update_admins-r2500.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;update_admins-r3243.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
*&amp;lt;tt&amp;gt;update_admins-r3444.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, you should run the scripts for &amp;lt;tt&amp;gt;3243&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;3444&amp;lt;/tt&amp;gt;, in that order, to bring your table up to date.  All data will be fully retained, but it is always recommended that you backup your data before proceeding with database changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Management Commands=&lt;br /&gt;
As a convenience, SourceMod provides a few basic SQL admin management commands via the &amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt; plugin.  All of the commands require the &amp;lt;tt&amp;gt;root&amp;lt;/tt&amp;gt; admin flag.&lt;br /&gt;
&lt;br /&gt;
The following conventions are used:&lt;br /&gt;
*When &amp;amp;lt;authtype&amp;amp;gt; is requested, it means one of the following three values: &amp;lt;tt&amp;gt;steam&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ip&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;.&lt;br /&gt;
*When &amp;amp;lt;identity&amp;amp;gt; is requested, it should be the unique string to be paired with the &amp;lt;tt&amp;gt;authtype&amp;lt;/tt&amp;gt;.  For example, a &amp;lt;tt&amp;gt;steam&amp;lt;/tt&amp;gt; identity would be a Steam ID.  An &amp;lt;tt&amp;gt;ip&amp;lt;/tt&amp;gt; identity would be an IP address, and a &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; identity would be a Half-Life 2 player name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note: if a string has spaces, it must be in quotes!&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note: A colon is a break character and Steam IDs must be in quotes!&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Command&lt;br /&gt;
| Format&lt;br /&gt;
| Description&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| sm_sql_addadmin&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;alias&amp;gt; &amp;lt;authtype&amp;gt; &amp;lt;identity&amp;gt; &amp;lt;flags&amp;gt; [immunity] [password]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Adds a new entry to the &amp;lt;tt&amp;gt;sm_admins&amp;lt;/tt&amp;gt; table.  The &amp;lt;tt&amp;gt;alias&amp;lt;/tt&amp;gt; can be any value and is usually used to assign a readable name to an IP/SteamID.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| sm_sql_deladmin&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;authtype&amp;gt; &amp;lt;identity&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Removes an admin.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| sm_sql_addgroup&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;name&amp;gt; &amp;lt;flags&amp;gt; &amp;lt;immunity&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Adds a new group with the specified flags and immunity&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| sm_sql_delgroup&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;name&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Removes the specified group.  Quotation marks are optional if the name has odd characters.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot; &lt;br /&gt;
| sm_sql_setadmingroups&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;authtype&amp;gt; &amp;lt;identity&amp;gt; [group1] ... [group N]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Sets an admin's group list.  The inheritance order is the order the groups are specified in.  This sets, and does not add; thus specifying no groups removes the user from all groups.  Example:&lt;br /&gt;
&amp;lt;tt&amp;gt;sm_sql_setadmingroups steam &amp;quot;STEAM_0:1:16&amp;quot; &amp;quot;Full Admins&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| sm_create_adm_tables&lt;br /&gt;
| &lt;br /&gt;
| Creates the administration tables for SourceMod.  Can only be run from the server console.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| sm_update_adm_tables&lt;br /&gt;
|&lt;br /&gt;
| Updates the administration tables to the latest schema, preserving data as applicable.  Can only be run from the server console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Frequently Asked Questions=&lt;br /&gt;
&amp;lt;b&amp;gt;Q:&amp;lt;/b&amp;gt; Can I use &amp;lt;tt&amp;gt;admin-sql&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;admin-flatfile&amp;lt;/tt&amp;gt; at the same time?&lt;br /&gt;
&amp;lt;b&amp;gt;A:&amp;lt;/b&amp;gt; Yes.  The data will be merged together in SourceMod's cache.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Q:&amp;lt;/b&amp;gt; Can I use both the &amp;lt;tt&amp;gt;threaded&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;prefetch&amp;lt;/tt&amp;gt; SQL plugins at the same time?&lt;br /&gt;
&amp;lt;b&amp;gt;A:&amp;lt;/b&amp;gt; No.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Q:&amp;lt;/b&amp;gt; Can duplicate groups/admins be in the flat files and the SQL database?&lt;br /&gt;
&amp;lt;b&amp;gt;A:&amp;lt;/b&amp;gt; Yup.  They will be merged safely.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Schemas=&lt;br /&gt;
This section documents the required portions of the admin table schema.  You do not need to read or learn this unless you plan to use SQL directly.&lt;br /&gt;
&lt;br /&gt;
The exact schemas for each driver are located in &amp;lt;tt&amp;gt;configs/sql-init-scripts&amp;lt;/tt&amp;gt;.  The purpose of this document is to explain the fields rather than list the exact structures.&lt;br /&gt;
&lt;br /&gt;
==sm_admins==&lt;br /&gt;
This table is used to store administrators.  Although the primary key is &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;, applications should enforce that &amp;lt;tt&amp;gt;authtype&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;identity&amp;lt;/tt&amp;gt; have no combined duplicates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Primary key:&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; (auto increments).&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Field&lt;br /&gt;
| Type&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| id&lt;br /&gt;
| integer&lt;br /&gt;
| Unique integer identifying the row.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| authtype&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
Constrained to 'steam', 'name', or 'ip'&lt;br /&gt;
| Authentication type the identity is against.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| identity&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Steam ID, name, or IP address.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| password&lt;br /&gt;
| string&lt;br /&gt;
| Password, if any, the admin must use.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| flags&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Permission flag string.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| name&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Alias used for external tools (all but ignored in SourceMod).&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| immunity&lt;br /&gt;
| integer NOT NULL&lt;br /&gt;
| Immunity level value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==sm_groups==&lt;br /&gt;
This table is used to store all groups entries.  Although the primary key is &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt;, applications should enforce that the &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; field stays unique.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Primary key:&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; (auto increments).&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Field&lt;br /&gt;
| Type&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| id&lt;br /&gt;
| integer&lt;br /&gt;
| Unique integer identifying the row.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| flags&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Permissions flag string.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| name&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Unique name of the group.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| immunity_level&lt;br /&gt;
| integer NOT NULL&lt;br /&gt;
| Immunity level value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==sm_admins_groups==&lt;br /&gt;
This table is used to map admins to the groups they will inherit.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Primary key:&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;admin_id&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;group_id&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Field&lt;br /&gt;
| Type&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| admin_id &lt;br /&gt;
| integer&lt;br /&gt;
| Reference to the &amp;lt;tt&amp;gt;sm_admins.id&amp;lt;/tt&amp;gt; field.  Specifies the admin inheriting the group.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| group_id&lt;br /&gt;
| integer&lt;br /&gt;
| Reference to the &amp;lt;tt&amp;gt;sm_groups.id&amp;lt;/tt&amp;gt; field.  Specifies the group the admin is inheriting.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| inherit_order&lt;br /&gt;
| integer NOT NULL&lt;br /&gt;
| Order of inheritance for the given admin.  Lower means earlier inheritance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==sm_group_immunity==&lt;br /&gt;
This table is used to map which groups are immune from other groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Primary key:&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;group_id&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;other_id&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Field&lt;br /&gt;
| Type&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| group_id&lt;br /&gt;
| integer&lt;br /&gt;
| Reference to the &amp;lt;tt&amp;gt;sm_groups.id&amp;lt;/tt&amp;gt; field.  Specifies the group gaining immunity.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| other_id&lt;br /&gt;
| integer&lt;br /&gt;
| Reference to the &amp;lt;tt&amp;gt;sm_groups.id&amp;lt;/tt&amp;gt; field.  Specifies who &amp;lt;tt&amp;gt;group_id&amp;lt;/tt&amp;gt; is becoming immune from.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==sm_group_overrides==&lt;br /&gt;
This table is used to specify group-based command overrides.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Primary key:&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;group_id&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Field&lt;br /&gt;
| Type&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| group_id&lt;br /&gt;
| integer&lt;br /&gt;
| Reference to the &amp;lt;tt&amp;gt;sm_groups.id&amp;lt;/tt&amp;gt; field.  Specifies the group the override is for.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| type&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
Constrained to 'command' or 'group'.&lt;br /&gt;
| Specifies whether the override is a command or a command group.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| name&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Command name.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| access&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
Constrained to 'allow' or 'deny'.&lt;br /&gt;
| Whether the command is allowed or denied to this group.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==sm_overrides==&lt;br /&gt;
This table is used to specify global command overrides.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Primary key:&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;type&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Field&lt;br /&gt;
| Type&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| type&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
Constrained to 'command' or 'group'.&lt;br /&gt;
| Specifies whether the override is a command or a command group.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| name&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Command name.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| flags&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Permissions flag string.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==sm_config==&lt;br /&gt;
This table is used to specify configuration options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Primary key:&amp;lt;/b&amp;gt; &amp;lt;tt&amp;gt;cfg_key&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
|- class=&amp;quot;t2th&amp;quot;&lt;br /&gt;
| Field&lt;br /&gt;
| Type&lt;br /&gt;
| Purpose&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| cfg_key&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Configuration key.&lt;br /&gt;
|- class=&amp;quot;t2td&amp;quot;&lt;br /&gt;
| cfg_value&lt;br /&gt;
| string NOT NULL&lt;br /&gt;
| Configuration value.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''Note:'' As of this writing, the only configuration value is &amp;lt;tt&amp;gt;admin_version&amp;lt;/tt&amp;gt;, and it specifies the revision the schema last changed.&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Documentation]]&lt;/div&gt;</summary>
		<author><name>HiJacker</name></author>
		
	</entry>
</feed>