<?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=Overriding_Command_Access_%28SourceMod%29%2Fzh</id>
	<title>Overriding Command Access (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=Overriding_Command_Access_%28SourceMod%29%2Fzh"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Overriding_Command_Access_(SourceMod)/zh&amp;action=history"/>
	<updated>2026-05-09T15:17:02Z</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=Overriding_Command_Access_(SourceMod)/zh&amp;diff=10851&amp;oldid=prev</id>
		<title>Yurizhou: /* 组配置 */</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Overriding_Command_Access_(SourceMod)/zh&amp;diff=10851&amp;oldid=prev"/>
		<updated>2019-09-12T10:02:30Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;组配置&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 10:02, 12 September 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l53&quot; &gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Group overrides are given on an allow or deny basis.&amp;#160; That is, rather than changing flags per-group, the override is simply whether it is allowed or denied to members of that group.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Group overrides are given on an allow or deny basis.&amp;#160; That is, rather than changing flags per-group, the override is simply whether it is allowed or denied to members of that group.&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;更多内容请参考[[Adding_Groups_%28SourceMod%29#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;File_Format&lt;/del&gt;|增加用户组]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;更多内容请参考[[Adding_Groups_%28SourceMod%29&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/zh&lt;/ins&gt;#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;文件格式&lt;/ins&gt;|增加用户组]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:SourceMod Documentation]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:SourceMod Documentation]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Yurizhou</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Overriding_Command_Access_(SourceMod)/zh&amp;diff=10816&amp;oldid=prev</id>
		<title>Yurizhou: Created page with &quot;{{Languages|Overriding Command Access (SourceMod)}} 这个文章介绍了如何在不改变插件源代码的情况下，去改变标志或者任何控制语句的权限。权...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Overriding_Command_Access_(SourceMod)/zh&amp;diff=10816&amp;oldid=prev"/>
		<updated>2019-09-09T08:04:15Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Languages|Overriding Command Access (SourceMod)}} 这个文章介绍了如何在不改变插件源代码的情况下，去改变标志或者任何控制语句的权限。权...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Languages|Overriding Command Access (SourceMod)}}&lt;br /&gt;
这个文章介绍了如何在不改变插件源代码的情况下，去改变标志或者任何控制语句的权限。权限既可以是全局的，也可以是给特定的组员的。&lt;br /&gt;
&lt;br /&gt;
=介绍=&lt;br /&gt;
重写权限是SourceMod管理系统中最为有力的特性之一。这能让你高效地:&lt;br /&gt;
*在不更改插件源码的前提下更改管理命令的权限&lt;br /&gt;
*不更改源码的情况下更改整个用户组的命令权限&lt;br /&gt;
*创建自定义权限级别&lt;br /&gt;
*无视命令的标志，允许或拒绝任何玩家或组的访问权限&lt;br /&gt;
&lt;br /&gt;
当你更改了一个SourceMod成员的权限，你就完成了&amp;quot;重写&amp;quot;这一动作。重写是一条字符串。如果这个字符串与命令名匹配，那么这个命令的权限将会从这条重写中继承（而不是代码中）。&lt;br /&gt;
&lt;br /&gt;
这个概念重要在于:&lt;br /&gt;
*重写能改变一条命令的权限。&lt;br /&gt;
*重写能被当作自定义的访问权限标志。&lt;br /&gt;
&lt;br /&gt;
例如，一个插件需要等级“g”才能使用&amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt;命令。然而，重写可以对特定的组直接同意或者拒绝这条命令的使用，也可以把默认需要的等级改为“k”。&lt;br /&gt;
&lt;br /&gt;
更有意思的事，一个插件可以要求使用特殊的菜单选项必须有权限访问&amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt;指令。在这种情况下，用户必须有&amp;lt;tt&amp;gt;sm_map&amp;lt;/tt&amp;gt;的权限，而不是一个硬编码的标志。&lt;br /&gt;
&lt;br /&gt;
最后一个例子，一个插件可能要求用户必须有权限访问&amp;lt;tt&amp;gt;plugin_crab_usage&amp;lt;/tt&amp;gt;,然而这完全不是一个命令。这意味着插件要求的只是默认权限，用户爱怎么重写怎么重写。这也暗示着重写是和命令无关的。但是，命令本身会从同名的重写中继承权限要求。&lt;br /&gt;
&lt;br /&gt;
更改重写文件不会立刻生效，你可以使用&amp;quot;sm_reloadadmins&amp;quot;指令来刷新。&lt;br /&gt;
&lt;br /&gt;
=重写方法=&lt;br /&gt;
重写有两种方法：重写指令和重写组。重写命令基于命令会自动继承同名的重写提供的权限要求。重写组则导致一个用户组有这个命令的权限。&lt;br /&gt;
&lt;br /&gt;
例如，如果一个重写为&amp;lt;tt&amp;gt;sm_map&amp;lt;tt&amp;gt;，任何&amp;lt;tt&amp;gt;sm_map&amp;lt;tt&amp;gt;的指令都会继承重写中的权限要求。&lt;br /&gt;
如果一个重写组为&amp;lt;tt&amp;gt;CSDM&amp;lt;/tt&amp;gt;，任何标记权限组为&amp;quot;CSDM&amp;quot;的成员都会获得该权限。&lt;br /&gt;
&lt;br /&gt;
=全局设置=&lt;br /&gt;
全局权限重写配置文件为&amp;lt;tt&amp;gt;configs/admin_overrides.cfg&amp;lt;/tt&amp;gt;。格式如下：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Overrides&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;[名字]&amp;quot;	&amp;quot;[标志]&amp;quot;&lt;br /&gt;
	&amp;quot;@[用户组]&amp;quot;	&amp;quot;[标志]&amp;quot;&lt;br /&gt;
	/* ... */&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
用户组会以“@”开头，例如：&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Overrides&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;sm_map&amp;quot;	&amp;quot;k&amp;quot;	//Change &amp;quot;sm_map&amp;quot; to the &amp;quot;k&amp;quot; flag.&lt;br /&gt;
	&amp;quot;@CSDM&amp;quot;		&amp;quot;m&amp;quot;	//Change all CSDM commands to the &amp;quot;m&amp;quot; flag.&lt;br /&gt;
	&amp;quot;sm_chat&amp;quot;	&amp;quot;&amp;quot;	//Allow anyone to use &amp;quot;sm_chat&amp;quot;空则代表不需要权限&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
注意，如果你给一堆权限要求，那么客户端就必须有所有需要的权限了，而不是任意一个。（例如&amp;quot;abc&amp;quot;需要你有三个权限，而不是任意一个）&lt;br /&gt;
=组配置=&lt;br /&gt;
Group overrides are given on an allow or deny basis.  That is, rather than changing flags per-group, the override is simply whether it is allowed or denied to members of that group.  &lt;br /&gt;
&lt;br /&gt;
更多内容请参考[[Adding_Groups_%28SourceMod%29#File_Format|增加用户组]].&lt;br /&gt;
&lt;br /&gt;
[[Category:SourceMod Documentation]]&lt;/div&gt;</summary>
		<author><name>Yurizhou</name></author>
		
	</entry>
</feed>