<?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=Checking_Admin_Flags_%28SourceMod_Scripting%29</id>
	<title>Checking Admin Flags (SourceMod Scripting) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alliedmods.net/index.php?action=history&amp;feed=atom&amp;title=Checking_Admin_Flags_%28SourceMod_Scripting%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;action=history"/>
	<updated>2026-06-24T16:16:54Z</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=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10926&amp;oldid=prev</id>
		<title>Joinedsenses: /* The last fallback: GetAdminFlag / GetUserFlagBits */ Update highlighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10926&amp;oldid=prev"/>
		<updated>2020-03-29T23:19:45Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;The last fallback: GetAdminFlag / GetUserFlagBits: &lt;/span&gt; Update highlighting&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 23:19, 29 March 2020&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-l129&quot; &gt;Line 129:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 129:&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;For example, if you want to check if a user has both the Generic and Kick flags, you can do so like this:&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;For example, if you want to check if a user has both the Generic and Kick flags, you can do so like this:&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;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pawn&lt;/del&gt;&amp;gt;if (GetUserFlagBits(client) &amp;amp; (ADMFLAG_GENERIC | ADMFLAG_KICK) == (ADMFLAG_GENERIC | ADMFLAG_KICK))&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;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sourcepawn&lt;/ins&gt;&amp;gt;if (GetUserFlagBits(client) &amp;amp; (ADMFLAG_GENERIC | ADMFLAG_KICK) == (ADMFLAG_GENERIC | ADMFLAG_KICK))&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;div&gt;{&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;{&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;div&gt;&amp;#160;&amp;#160; &amp;#160; // User has both flags&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;&amp;#160;&amp;#160; &amp;#160; // User has both flags&lt;/div&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;}&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pawn&lt;/del&gt;&amp;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;}&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sourcepawn&lt;/ins&gt;&amp;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;If you're reading flags from a string somewhere, such as from a convar (which is a terrible idea, you should go back up and read the [[#Checking inside an existing command: CheckCommandAccess|CheckCommandAccess]] section above), you can use the [https://sm.alliedmods.net/new-api/admin/ReadFlagString ReadFlagString] section command to turn a string into a set of flag bits, which you can use in place of the flags in the previous section, such as this:&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;If you're reading flags from a string somewhere, such as from a convar (which is a terrible idea, you should go back up and read the [[#Checking inside an existing command: CheckCommandAccess|CheckCommandAccess]] section above), you can use the [https://sm.alliedmods.net/new-api/admin/ReadFlagString ReadFlagString] section command to turn a string into a set of flag bits, which you can use in place of the flags in the previous section, such as this:&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;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pawn&lt;/del&gt;&amp;gt;int flags = ReadFlagString(myflags);&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;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sourcepawn&lt;/ins&gt;&amp;gt;int flags = ReadFlagString(myflags);&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;div&gt;if (GetUserFlagBits(client) &amp;amp; flags == flags)&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;if (GetUserFlagBits(client) &amp;amp; flags == flags)&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;div&gt;{&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;{&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;div&gt;&amp;#160;&amp;#160; &amp;#160; // User has all the flags in the myflags string.&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;&amp;#160;&amp;#160; &amp;#160; // User has all the flags in the myflags string.&lt;/div&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;}&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pawn&lt;/del&gt;&amp;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;}&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sourcepawn&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Joinedsenses</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10925&amp;oldid=prev</id>
		<title>Joinedsenses: /* Checking inside an existing command: CheckCommandAccess */ Update highlighting</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10925&amp;oldid=prev"/>
		<updated>2020-03-29T23:19:20Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Checking inside an existing command: CheckCommandAccess: &lt;/span&gt; Update highlighting&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 23:19, 29 March 2020&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-l107&quot; &gt;Line 107:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 107:&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;To make a command have the same override as earlier, it would look like this:&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;To make a command have the same override as earlier, it would look like this:&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;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pawn&lt;/del&gt;&amp;gt;if (CheckCommandAccess(client, &amp;quot;mycommand&amp;quot;, ADMFLAG_GENERIC))&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;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sourcepawn&lt;/ins&gt;&amp;gt;if (CheckCommandAccess(client, &amp;quot;mycommand&amp;quot;, ADMFLAG_GENERIC))&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;div&gt;{&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;{&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;div&gt;&amp;#160;&amp;#160; &amp;#160; // They have the &amp;quot;mycommand&amp;quot; override or the generic admin flag if no override exists&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;&amp;#160;&amp;#160; &amp;#160; // They have the &amp;quot;mycommand&amp;quot; override or the generic admin flag if no override exists&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;div&gt;}&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;}&lt;/div&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;&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pawn&lt;/del&gt;&amp;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;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sourcepawn&lt;/ins&gt;&amp;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;[https://sm.alliedmods.net/new-api/console/CheckAccess CheckAccess] is a variation of this command if you have an AdminId from an admin lookup already.&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;[https://sm.alliedmods.net/new-api/console/CheckAccess CheckAccess] is a variation of this command if you have an AdminId from an admin lookup already.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Joinedsenses</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10048&amp;oldid=prev</id>
		<title>Powerlord: Fixed the argument list for CheckCommandAccess</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10048&amp;oldid=prev"/>
		<updated>2015-10-26T21:05:07Z</updated>

		<summary type="html">&lt;p&gt;Fixed the argument list for CheckCommandAccess&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 21:05, 26 October 2015&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-l98&quot; &gt;Line 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&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;CheckCommandAccess takes four arguments.&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;CheckCommandAccess takes four arguments.&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;The &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;first argument is the &lt;/del&gt;client index who you want to check.&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/ins&gt;The client index who you want to check.&lt;/div&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;The &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;second argument is the &lt;/del&gt;name of the override that this command should use.&amp;#160; It can either be a new override or an existing override or command name.&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/ins&gt;The name of the override that this command should use.&amp;#160; It can either be a new override or an existing override or command name.&lt;/div&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;The &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;third argument is the &lt;/del&gt;default admin flag(s) that you want to use for this.&amp;#160; This flag(s) are used when no overrides are present.&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/ins&gt;The default admin flag(s) that you want to use for this.&amp;#160; This flag(s) are used when no overrides are present.&lt;/div&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;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The fourth &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;optional&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;argument is a &lt;/del&gt;boolean that tells SourceMod whether it should look for a command with the override's name (false) or if it should just look for the override in the overrides table (true).&amp;#160; Default is '''false'''.&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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;# &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Optional&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;A &lt;/ins&gt;boolean that tells SourceMod whether it should look for a command with the override's name (false) or if it should just look for the override in the overrides table (true).&amp;#160; Default is '''false'''.&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;CheckCommandAccess returns true if the client has the appropriate permissions or false if they do not.&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;CheckCommandAccess returns true if the client has the appropriate permissions or false if they do not.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Powerlord</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10047&amp;oldid=prev</id>
		<title>Powerlord: Really dumb mistake</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10047&amp;oldid=prev"/>
		<updated>2015-10-26T21:03:01Z</updated>

		<summary type="html">&lt;p&gt;Really dumb mistake&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 21:03, 26 October 2015&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-l52&quot; &gt;Line 52:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 52:&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;Now, change the RegConsoleCmd to a RegAdminCmd and add the required flag(s) as the third argument:&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;Now, change the RegConsoleCmd to a RegAdminCmd and add the required flag(s) as the third argument:&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;&amp;lt;pawn&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;RegConsoleCmd&lt;/del&gt;(&amp;quot;mycommand&amp;quot;, Cmd_MyCommand, ADMFLAG_GENERIC, &amp;quot;This is my great command&amp;quot;);&amp;lt;/pawn&amp;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;&amp;lt;pawn&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;RegAdminCmd&lt;/ins&gt;(&amp;quot;mycommand&amp;quot;, Cmd_MyCommand, ADMFLAG_GENERIC, &amp;quot;This is my great command&amp;quot;);&amp;lt;/pawn&amp;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;Now you have a command that requires the generic admin flag!&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;Now you have a command that requires the generic admin flag!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Powerlord</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10046&amp;oldid=prev</id>
		<title>Powerlord: New page for checking admin flags.</title>
		<link rel="alternate" type="text/html" href="https://wiki.alliedmods.net/index.php?title=Checking_Admin_Flags_(SourceMod_Scripting)&amp;diff=10046&amp;oldid=prev"/>
		<updated>2015-10-26T21:02:21Z</updated>

		<summary type="html">&lt;p&gt;New page for checking admin flags.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Admin flags control which users can use particular commands.&lt;br /&gt;
&lt;br /&gt;
They also interact with the Overrides system.&lt;br /&gt;
&lt;br /&gt;
There are multiple different ways to check flags.  The major ones are documented below.&lt;br /&gt;
&lt;br /&gt;
==List of Admin Flag Bits==&lt;br /&gt;
&lt;br /&gt;
Most of the admin related functions in SourceMod use a bitmask of admin flag bits. As such, here is the list of constants located in admin.inc that you can use.&lt;br /&gt;
&lt;br /&gt;
''Note: Do not include this list of defines in your own code, just the ADMFLAG_WHATEVER name.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;/**&lt;br /&gt;
 * @section Bitwise values definitions for admin flags.&lt;br /&gt;
 */&lt;br /&gt;
#define ADMFLAG_RESERVATION			(1&amp;lt;&amp;lt;0)		/**&amp;lt; Convenience macro for Admin_Reservation as a FlagBit */&lt;br /&gt;
#define ADMFLAG_GENERIC				(1&amp;lt;&amp;lt;1)		/**&amp;lt; Convenience macro for Admin_Generic as a FlagBit */&lt;br /&gt;
#define ADMFLAG_KICK				(1&amp;lt;&amp;lt;2)		/**&amp;lt; Convenience macro for Admin_Kick as a FlagBit */&lt;br /&gt;
#define ADMFLAG_BAN					(1&amp;lt;&amp;lt;3)		/**&amp;lt; Convenience macro for Admin_Ban as a FlagBit */&lt;br /&gt;
#define ADMFLAG_UNBAN				(1&amp;lt;&amp;lt;4)		/**&amp;lt; Convenience macro for Admin_Unban as a FlagBit */&lt;br /&gt;
#define ADMFLAG_SLAY				(1&amp;lt;&amp;lt;5)		/**&amp;lt; Convenience macro for Admin_Slay as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CHANGEMAP			(1&amp;lt;&amp;lt;6)		/**&amp;lt; Convenience macro for Admin_Changemap as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CONVARS				(1&amp;lt;&amp;lt;7)		/**&amp;lt; Convenience macro for Admin_Convars as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CONFIG				(1&amp;lt;&amp;lt;8)		/**&amp;lt; Convenience macro for Admin_Config as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CHAT				(1&amp;lt;&amp;lt;9)		/**&amp;lt; Convenience macro for Admin_Chat as a FlagBit */&lt;br /&gt;
#define ADMFLAG_VOTE				(1&amp;lt;&amp;lt;10)		/**&amp;lt; Convenience macro for Admin_Vote as a FlagBit */&lt;br /&gt;
#define ADMFLAG_PASSWORD			(1&amp;lt;&amp;lt;11)		/**&amp;lt; Convenience macro for Admin_Password as a FlagBit */&lt;br /&gt;
#define ADMFLAG_RCON				(1&amp;lt;&amp;lt;12)		/**&amp;lt; Convenience macro for Admin_RCON as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CHEATS				(1&amp;lt;&amp;lt;13)		/**&amp;lt; Convenience macro for Admin_Cheats as a FlagBit */&lt;br /&gt;
#define ADMFLAG_ROOT				(1&amp;lt;&amp;lt;14)		/**&amp;lt; Convenience macro for Admin_Root as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CUSTOM1				(1&amp;lt;&amp;lt;15)		/**&amp;lt; Convenience macro for Admin_Custom1 as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CUSTOM2				(1&amp;lt;&amp;lt;16)		/**&amp;lt; Convenience macro for Admin_Custom2 as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CUSTOM3				(1&amp;lt;&amp;lt;17)		/**&amp;lt; Convenience macro for Admin_Custom3 as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CUSTOM4				(1&amp;lt;&amp;lt;18)		/**&amp;lt; Convenience macro for Admin_Custom4 as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CUSTOM5				(1&amp;lt;&amp;lt;19)		/**&amp;lt; Convenience macro for Admin_Custom5 as a FlagBit */&lt;br /&gt;
#define ADMFLAG_CUSTOM6				(1&amp;lt;&amp;lt;20)		/**&amp;lt; Convenience macro for Admin_Custom6 as a FlagBit */&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since these are just bits, you can combine them to make a command require more than one admin flag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;ADMFLAG_GENERIC | ADMFLAG_KICK&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Creating Admin Commands instead of Commands==&lt;br /&gt;
&lt;br /&gt;
The simplest form of flag checking is to create an admin command instead of a normal command.&lt;br /&gt;
&lt;br /&gt;
The standard syntax for creating a command looks something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;RegConsoleCmd(&amp;quot;mycommand&amp;quot;, Cmd_MyCommand, &amp;quot;This is my great command&amp;quot;);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to restrict this to admin users only, first you need to select an admin flag from the above list.&lt;br /&gt;
&lt;br /&gt;
Now, change the RegConsoleCmd to a RegAdminCmd and add the required flag(s) as the third argument:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;RegConsoleCmd(&amp;quot;mycommand&amp;quot;, Cmd_MyCommand, ADMFLAG_GENERIC, &amp;quot;This is my great command&amp;quot;);&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have a command that requires the generic admin flag!&lt;br /&gt;
&lt;br /&gt;
==Command and Group Overrides==&lt;br /&gt;
&lt;br /&gt;
Any normal or admin command can have a command override placed on it using either Command Overrides or Group Overrides.&lt;br /&gt;
&lt;br /&gt;
===Command Overrides===&lt;br /&gt;
&lt;br /&gt;
[[Overriding Command Access (SourceMod)|Command overrides]] are used to change the admin flag that a command checks.  For example, to override the admin command created in one of the previous sections, I could open &amp;lt;tt&amp;gt;addons/sourcemod/configs/admin_overrides.cfg&amp;lt;/tt&amp;gt; and put this somewhere before the last bracket:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;mycommand&amp;quot;   &amp;quot;a&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;a&amp;quot; can be any of the [[Adding Admins (SourceMod)#Levels|admin flags]] SourceMod uses.  &amp;quot;a&amp;quot; itself is Reserved slot access.&lt;br /&gt;
&lt;br /&gt;
If a command is part of a Command Group, you can override the entire command group by putting the command group name with a @ before it.  Only admin commands can have a command group.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;@mycommandgroup&amp;quot;      &amp;quot;a&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Admin Group Overrides===&lt;br /&gt;
&lt;br /&gt;
Admin Group overrides are a bit different than Command overrides.  First, they only apply to [[Adding Groups (SourceMod)|admin groups]].&lt;br /&gt;
&lt;br /&gt;
Second, they are listed as &amp;quot;allow&amp;quot; or &amp;quot;deny&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For example, if I wanted to make it so that the &amp;quot;badgroup&amp;quot; cannot use &amp;quot;mycommand&amp;quot;, I would do this in &amp;lt;tt&amp;gt;admin/sourcemod/configs/admin_groups.cfg&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;quot;badgroup&amp;quot;&lt;br /&gt;
    {&lt;br /&gt;
        Overrides&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;mycommand&amp;quot;    &amp;quot;deny&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then I would assign users to this group.&lt;br /&gt;
&lt;br /&gt;
==Checking inside an existing command: CheckCommandAccess==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you may want to treat a command differently if a user has a specific flag.  This may even be something you enable and disable using a cvar.&lt;br /&gt;
&lt;br /&gt;
The best way to do this is the [https://sm.alliedmods.net/new-api/console/CheckCommandAccess CheckCommandAccess] command.&lt;br /&gt;
&lt;br /&gt;
CheckCommandAccess takes four arguments.&lt;br /&gt;
&lt;br /&gt;
The first argument is the client index who you want to check.&lt;br /&gt;
The second argument is the name of the override that this command should use.  It can either be a new override or an existing override or command name.&lt;br /&gt;
The third argument is the default admin flag(s) that you want to use for this.  This flag(s) are used when no overrides are present.&lt;br /&gt;
The fourth (optional) argument is a boolean that tells SourceMod whether it should look for a command with the override's name (false) or if it should just look for the override in the overrides table (true).  Default is '''false'''.&lt;br /&gt;
&lt;br /&gt;
CheckCommandAccess returns true if the client has the appropriate permissions or false if they do not.&lt;br /&gt;
&lt;br /&gt;
To make a command have the same override as earlier, it would look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;if (CheckCommandAccess(client, &amp;quot;mycommand&amp;quot;, ADMFLAG_GENERIC))&lt;br /&gt;
{&lt;br /&gt;
    // They have the &amp;quot;mycommand&amp;quot; override or the generic admin flag if no override exists&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://sm.alliedmods.net/new-api/console/CheckAccess CheckAccess] is a variation of this command if you have an AdminId from an admin lookup already.&lt;br /&gt;
&lt;br /&gt;
==The last fallback: GetAdminFlag / GetUserFlagBits==&lt;br /&gt;
&lt;br /&gt;
'''These two commands are the brute force method and should only be used as a last resort.'''  You should '''always''' use [[#Checking inside an existing command: CheckCommandAccess|CheckCommandAccess]] in preference to this.&lt;br /&gt;
&lt;br /&gt;
These commands '''do not''' participate in the overrides system.&lt;br /&gt;
&lt;br /&gt;
In order to use GetAdminFlag, you need to first get a client's AdminId.  This is done using the [https://sm.alliedmods.net/new-api/clients/GetUserAdmin GetUserAdmin] command.  This will return an AdminId or the value &amp;lt;tt&amp;gt;INVALID_ADMIN_ID&amp;lt;/tt&amp;gt; if the user is not an admin.&lt;br /&gt;
&lt;br /&gt;
Then, you can use [https://sm.alliedmods.net/new-api/admin/GetAdminFlag GetAdminFlag] to see if a user has a particular AdminFlag.  Note:  This uses the [https://sm.alliedmods.net/new-api/admin/AdminFlag AdminFlag enum] instead of the Admin flag bits shown earlier.&lt;br /&gt;
&lt;br /&gt;
If you need to check for the existence of multiple flags, you can use [https://sm.alliedmods.net/new-api/clients/GetUserFlagBits GetUserFlagBits] instead.  GetUserFlagBits takes a client index and will return a value that contains all the flags that a user has.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to check if a user has both the Generic and Kick flags, you can do so like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;if (GetUserFlagBits(client) &amp;amp; (ADMFLAG_GENERIC | ADMFLAG_KICK) == (ADMFLAG_GENERIC | ADMFLAG_KICK))&lt;br /&gt;
{&lt;br /&gt;
    // User has both flags&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you're reading flags from a string somewhere, such as from a convar (which is a terrible idea, you should go back up and read the [[#Checking inside an existing command: CheckCommandAccess|CheckCommandAccess]] section above), you can use the [https://sm.alliedmods.net/new-api/admin/ReadFlagString ReadFlagString] section command to turn a string into a set of flag bits, which you can use in place of the flags in the previous section, such as this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pawn&amp;gt;int flags = ReadFlagString(myflags);&lt;br /&gt;
if (GetUserFlagBits(client) &amp;amp; flags == flags)&lt;br /&gt;
{&lt;br /&gt;
    // User has all the flags in the myflags string.&lt;br /&gt;
}&amp;lt;/pawn&amp;gt;&lt;/div&gt;</summary>
		<author><name>Powerlord</name></author>
		
	</entry>
</feed>