<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alliedmods.net/index.php?action=history&amp;feed=atom&amp;title=SQL_Admins_%28SourceMod%29%2Fzh</id>
	<title>SQL Admins (SourceMod)/zh - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/index.php?action=history&amp;feed=atom&amp;title=SQL_Admins_%28SourceMod%29%2Fzh"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=SQL_Admins_(SourceMod)/zh&amp;action=history"/>
	<updated>2026-06-22T06:37:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=SQL_Admins_(SourceMod)/zh&amp;diff=10864&amp;oldid=prev</id>
		<title>MisakaSora: half translated</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=SQL_Admins_(SourceMod)/zh&amp;diff=10864&amp;oldid=prev"/>
		<updated>2019-09-20T10:05:02Z</updated>

		<summary type="html">&lt;p&gt;half translated&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Languages|SQL Admins (SourceMod)}}&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
SourceMod已经支持通过SQL来加载管理admin，现在支持是数据库是MySQL和SQLite。如果你有大量管理员、你想通过外部工具管理或者你想在不同服务器中 共享管理员，使用数据库是非常有效的。 &lt;br /&gt;
&lt;br /&gt;
本文会介绍如何配置服务器来使用SQL管理admin。基础管理不需要SQL知识，但是使用这个功能，你必须意识到SourceMod并不会为完整的SQL控制提供简单的功能。如果你需要更好的功能，你需要使用三方工具或者自学SQL。&lt;br /&gt;
&lt;br /&gt;
不过，先假设你会:&lt;br /&gt;
*能访问一个数据库，&lt;br /&gt;
*明白如何访问一个数据库;&lt;br /&gt;
*明白如何在数据库中执行指令或者脚本。&lt;br /&gt;
&lt;br /&gt;
=配置=&lt;br /&gt;
==MySQL==&lt;br /&gt;
打开服务器的&amp;lt;tt&amp;gt;configs/databases.cfg&amp;lt;/tt&amp;gt;文件，你应该会看到有一个叫&amp;lt;tt&amp;gt;&amp;quot;default&amp;quot;&amp;lt;/tt&amp;gt;的节点。你可以使用这个，如果你想分开连接也可以创建一个新的&amp;lt;tt&amp;gt;&amp;quot;admins&amp;quot;&amp;lt;/tt&amp;gt;节点。你必须填充&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;和&amp;lt;tt&amp;gt;pass&amp;lt;/tt&amp;gt;的值，如果有值不需要填，填个双引号即可（&amp;lt;tt&amp;gt;&amp;quot;&amp;quot;&amp;lt;/tt&amp;gt;），每个'srcds'的实例都需要重启，否则改动不生效。&lt;br /&gt;
&lt;br /&gt;
例子：&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;数据库&amp;quot;&lt;br /&gt;
		&amp;quot;database&amp;quot;			&amp;quot;数据库名字&amp;quot;&lt;br /&gt;
		&amp;quot;user&amp;quot;				&amp;quot;账号&amp;quot;&lt;br /&gt;
		&amp;quot;pass&amp;quot;				&amp;quot;密码&amp;quot;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SQLite==&lt;br /&gt;
在你服务器的&amp;lt;tt&amp;gt;configs/databases.cfg&amp;lt;/tt&amp;gt;文件中添加一个如下的节点：&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;
你可以使用任意合法的文件名作为数据库的名字，这里用“admins-sqlite”是因为这是预置的数据库，&amp;lt;tt&amp;gt;configs/sql-init-scripts/sqlite&amp;lt;/tt&amp;gt;目录下可以找到&amp;lt;tt&amp;gt;admins-sqlite&amp;lt;/tt&amp;gt;文件。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=数据库设置=&lt;br /&gt;
==自动==&lt;br /&gt;
确保&amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt;已加载，然后在'''服务器控制台'''中执行&amp;lt;tt&amp;gt;sm_create_adm_tables&amp;lt;/tt&amp;gt;。如果使用的是MySQL，你需要有数据库的&amp;lt;tt&amp;gt;CREATE&amp;lt;/tt&amp;gt;权限。&lt;br /&gt;
&lt;br /&gt;
==手动==&lt;br /&gt;
===MySQL===&lt;br /&gt;
如果你还没有在你的MySQL中创建数据库里，这样做。&lt;br /&gt;
&lt;br /&gt;
找到SourceMod中的&amp;lt;tt&amp;gt;configs/sql-init-scripts/mysql/create_admins.sql&amp;lt;/tt&amp;gt;脚本。然后通过数据库命令行或者类似[http://www.phpmyadmin.net/ phpMyAdmin]的工具执行里面的内容，这个脚本会创建必要的表。&lt;br /&gt;
&lt;br /&gt;
===SQLite===&lt;br /&gt;
SourceMod发布有一个预置的SQLite数据库文件，里面已经建好所有的表。如果你想手动创建数据库或者添加表，使用&amp;lt;tt&amp;gt;configs/sql-init-scripts/sqlite/create_admins.sql&amp;lt;/tt&amp;gt;脚本的内容。&lt;br /&gt;
&lt;br /&gt;
把二进制文件&amp;lt;tt&amp;gt;configs/sql-init-scripts/sqlite/admins-sqlite.sq3&amp;lt;/tt&amp;gt;拷贝至你服务器的&amp;lt;tt&amp;gt;data/sqlite&amp;lt;/tt&amp;gt;目录下，如果你在&amp;lt;tt&amp;gt;databases.cfg&amp;lt;/tt&amp;gt;中重命名了数据库，那么你应该也同时重命名这个文件。&lt;br /&gt;
&lt;br /&gt;
=启用插件=&lt;br /&gt;
所有的SQL插件都在&amp;lt;tt&amp;gt;plugins/disabled&amp;lt;/tt&amp;gt;目录下——默认不加载。要启用插件，只需要把他们从&amp;lt;tt&amp;gt;plugins/disabled&amp;lt;/tt&amp;gt;目录移动到&amp;lt;tt&amp;gt;plugins&amp;lt;/tt&amp;gt;目录下。&lt;br /&gt;
&lt;br /&gt;
你会比较想启用&amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt;插件，因为它提供了一些非常有用的控制台指令来进行管理。但是，另外两个插件，你同时只能启用其中'''一个'''： 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;: 这个插件是中小型低延迟数据库的理想选择，它在地图加载时加载权限（或者主动刷新时），如果数据库延迟很大，或者你希望增删改权限后不需要刷新每个服务器的缓存，那么这个插件不适合你。&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;优点:&amp;lt;/b&amp;gt; 非常简单的插件，不复杂&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;缺点:&amp;lt;/b&amp;gt; 当缓存刷新时服务器会有延迟（地图加载或者使用&amp;lt;tt&amp;gt;sm_reloadadmins&amp;lt;/tt&amp;gt;）。如果你增删改权限表了，在缓存刷新前改动不会有体现。&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;: 这个插件完全线程化了。因此它十分复杂，现在也是“实验”性质的（尽管测试运行良好）。它预加载所有的组权限和覆写信息，管理员查找也是动态完成的。&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;优点:&amp;lt;/b&amp;gt;糟糕的数据库连接不会卡顿服务器。如果你增删改了管理员，变动会在玩家连接服务器时实时体现。&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;缺点:&amp;lt;/b&amp;gt;代码非常复杂，不适合作自定义修改，同时它有一些副作用（比如，&amp;lt;tt&amp;gt;sm_reloadadmins&amp;lt;/tt&amp;gt;指令会有轻微的延迟，因为插件是多线程的）&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;
一旦你启用了管理插件，并且启用了&amp;lt;tt&amp;gt;admin-sql&amp;lt;/tt&amp;gt;插件的其中&amp;lt;b&amp;gt;一个&amp;lt;/b&amp;gt;，那么可以继续往下了。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=更新表=&lt;br /&gt;
==自动==&lt;br /&gt;
确保插件&amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt;已加载，然后在服务器控制台中执行&amp;lt;tt&amp;gt;sm_update_adm_tables&amp;lt;/tt&amp;gt;指令，如果你使用的是MySQL，你必须就有数据库的&amp;lt;tt&amp;gt;CREATE&amp;lt;/tt&amp;gt;和&amp;lt;tt&amp;gt;ALTER&amp;lt;/tt&amp;gt;权限。&lt;br /&gt;
&lt;br /&gt;
==手动==&lt;br /&gt;
如果你正在使用的是旧版SourceMod表结构，那么更新最新架构的表结构非常重要。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;总结一下&amp;lt;/b&amp;gt;:&lt;br /&gt;
*先备份所有数据。&lt;br /&gt;
*要明确你的旧表是依据什么建立的，不幸的是，目前唯一的办法就是记住你当时使用的SourceMod版本。&lt;br /&gt;
*找到所有服务器上像&amp;lt;tt&amp;gt;update_admins-rXXXX&amp;lt;/tt&amp;gt;这个格式的脚本，其中&amp;lt;tt&amp;gt;XXXX&amp;lt;/tt&amp;gt;是修订的版本号，需要的是版本比第二步中的高，但比你现在使用的版本低或者相同的脚本。&lt;br /&gt;
*按照递增的修订号执行匹配的脚本（最低的先执行，最高的最后执行）。&lt;br /&gt;
*升级SQL插件，以及任何依赖于管理员表的第三方软件。&lt;br /&gt;
&lt;br /&gt;
升级表结构的脚本在&amp;lt;tt&amp;gt;configs/sql-init-scripts/&amp;amp;lt;driver&amp;amp;gt;/update_admins-rXXXX&amp;lt;/tt&amp;gt;，其中XXXX是修订版本号。&lt;br /&gt;
&lt;br /&gt;
下面是一种可能的场景。（&amp;lt;b&amp;gt;数据是编的，实际的修订版本号完全不同&amp;lt;/b&amp;gt;）。&lt;br /&gt;
&lt;br /&gt;
你的表是在r2978版的SourceMod下建立的，现在的版本是3512，那么下面是可能存在的文件：&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;
在这种情况下，你应当依次执行脚本&amp;lt;tt&amp;gt;3243&amp;lt;/tt&amp;gt;和&amp;lt;tt&amp;gt;3444&amp;lt;/tt&amp;gt;，来把你的表升级到最新版。所有的数据都会被保留，但是还是推荐你在作数据库变更时进行数据备份。&lt;br /&gt;
&lt;br /&gt;
=管理命令=&lt;br /&gt;
出于方便考虑，SourceMod通过插件&amp;lt;tt&amp;gt;sql-admin-manager.smx&amp;lt;/tt&amp;gt;提供了一些基础的数据库的管理员管理命令。所有的命令都需要&amp;lt;tt&amp;gt;root&amp;lt;tt&amp;gt;的管理flag。&lt;br /&gt;
&lt;br /&gt;
下面是一些使用惯例：&lt;br /&gt;
*当&amp;amp;lt;authtype&amp;amp;gt;被请求时，它意味着下面三者之一的值，&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;
*当&amp;amp;lt;identity&amp;amp;gt;被请求时，它是跟&amp;lt;tt&amp;gt;authtype&amp;lt;/tt&amp;gt;匹配的唯一字符串。例如，&amp;lt;tt&amp;gt;steam&amp;lt;/tt&amp;gt;代表Steam Id，&amp;lt;tt&amp;gt;ip&amp;lt;/tt&amp;gt;代表IP地址，&amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;代表半条命2中玩家的昵称。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意: 如果字符串中有空格，那么它要用引号括起来！（译注：整个子串用引号括起来）&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;注意: 冒号是中断字符，所以Steam Id必须用引号括起来！&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
友情翻译[[User:MisakaSora|MisakaSora]]&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Documentation]]&lt;/div&gt;</summary>
		<author><name>MisakaSora</name></author>
		
	</entry>
</feed>