Difference between revisions of "Admin Commands (SourceMod)"

From AlliedModders Wiki
Jump to: navigation, search
(Improved tables and formatting)
Line 40: Line 40:
 
These are basic commands found in plugins that have been deemed safe for [[War_Mode_(SourceMod)|War Mode]]; they provide simple functionality for administering your server.
 
These are basic commands found in plugins that have been deemed safe for [[War_Mode_(SourceMod)|War Mode]]; they provide simple functionality for administering your server.
  
:{| cellpadding="6"
+
{| class="wikitable"
|- class="t2th"
+
! Command
| Command
+
! Plugin
| Plugin
+
! Access
| Access
+
! Format
| Format
+
! Description
| Description
+
|-
|- class="t2td"
 
 
| sm_addban
 
| sm_addban
 
| basebans
 
| basebans
Line 53: Line 52:
 
| <time> <steamid> [reason]
 
| <time> <steamid> [reason]
 
| Adds a Steam ID to Source's ban list.
 
| Adds a Steam ID to Source's ban list.
|- class="t2td"
+
|-
 
| sm_admin
 
| sm_admin
 
| adminmenu
 
| adminmenu
Line 59: Line 58:
 
|
 
|
 
| Displays the [[Admin Menu (SourceMod)|admin menu]].
 
| Displays the [[Admin Menu (SourceMod)|admin menu]].
|- class="t2td"
+
|-
 
| sm_ban
 
| sm_ban
 
| basebans
 
| basebans
Line 65: Line 64:
 
| <nowiki><#userid|name> <minutes|0> </nowiki>[reason]
 
| <nowiki><#userid|name> <minutes|0> </nowiki>[reason]
 
| Bans a client.
 
| Bans a client.
|- class="t2td"
+
|-
 
| sm_banip
 
| sm_banip
 
| basebans
 
| basebans
Line 71: Line 70:
 
| <nowiki><ip|#userid|name> <time></nowiki> [reason]
 
| <nowiki><ip|#userid|name> <time></nowiki> [reason]
 
| Adds an IP address to Source's ban list.  Only someone with <tt>rcon</tt> access can ban an arbitrary IP.
 
| Adds an IP address to Source's ban list.  Only someone with <tt>rcon</tt> access can ban an arbitrary IP.
|- class="t2td"
+
|-
 
| sm_cancelvote
 
| sm_cancelvote
 
| basecommands
 
| basecommands
Line 77: Line 76:
 
|
 
|
 
| Cancels any vote in progress.
 
| Cancels any vote in progress.
|- class="t2td"
+
|-
 
| sm_cvar
 
| sm_cvar
 
| basecommands
 
| basecommands
 
| cvar
 
| cvar
 
| <cvar> [value]
 
| <cvar> [value]
| Retrieves or changes a cvar value.  Protected cvars can only be accessed with rcon access, and sv_cheats can only be accessed with cheat access.
+
| Retrieves or changes a cvar value.  Protected cvars can only be accessed with password access, and sv_cheats can only be accessed with cheat access. To add a cvar to the protected list (which by default contains all cvars flagged PROTECTED, rcon_password, sm_show_activity, and sm_immunity_mode), use sm_cvar protect <name>.
|- class="t2td"
+
|-
 
| sm_execcfg
 
| sm_execcfg
 
| basecommands
 
| basecommands
Line 89: Line 88:
 
| <filename>
 
| <filename>
 
| Executes a config file (path not needed, but extension is).
 
| Executes a config file (path not needed, but extension is).
|- class="t2td"
+
|-
 
| sm_help
 
| sm_help
 
| adminhelp
 
| adminhelp
Line 95: Line 94:
 
| [page|search]
 
| [page|search]
 
| Lists all admin commands.  Output is paginated and a page number can be specified.  Alternately, a search term can be specified to search for a specific command.
 
| Lists all admin commands.  Output is paginated and a page number can be specified.  Alternately, a search term can be specified to search for a specific command.
|- class="t2td"
+
|-
 
| sm_kick
 
| sm_kick
 
| basecommands
 
| basecommands
Line 101: Line 100:
 
| <nowiki><#userid|name></nowiki> [reason]
 
| <nowiki><#userid|name></nowiki> [reason]
 
| Kicks a player.
 
| Kicks a player.
|- class="t2td"
+
|-
 
| sm_map
 
| sm_map
 
| basecommands
 
| basecommands
Line 107: Line 106:
 
| <map>
 
| <map>
 
| Changes the current map.
 
| Changes the current map.
|- class="t2td"
+
|-
 
| sm_rcon
 
| sm_rcon
 
| basecommands
 
| basecommands
Line 113: Line 112:
 
| <argstring>
 
| <argstring>
 
| Executes the argument string via rcon.  You will only see RCON output on SourceMod 1.4 or above.
 
| Executes the argument string via rcon.  You will only see RCON output on SourceMod 1.4 or above.
|- class="t2td"
+
|-
 
| sm_reloadadmins
 
| sm_reloadadmins
 
| basecommands
 
| basecommands
Line 119: Line 118:
 
|
 
|
 
| Refreshes the Admin cache from all sources.
 
| Refreshes the Admin cache from all sources.
|- class="t2td"
+
|-
 
| sm_unban
 
| sm_unban
 
| basebans
 
| basebans
Line 125: Line 124:
 
| <nowiki><steamid|ip></nowiki>
 
| <nowiki><steamid|ip></nowiki>
 
| Unbans a Steam ID or an IP.
 
| Unbans a Steam ID or an IP.
|- class="t2td"
+
|-
 
| sm_who
 
| sm_who
 
| basecommands
 
| basecommands
Line 136: Line 135:
 
These commands provide extended functionality that may not be present on all games, either due to game or engine differences.  In general, they work on the most popular mods.  If you have a mod which is new, or not supported yet due to lower popularity, file a [http://bugs.alliedmods.net/index.php?project=5&do=index feature request].
 
These commands provide extended functionality that may not be present on all games, either due to game or engine differences.  In general, they work on the most popular mods.  If you have a mod which is new, or not supported yet due to lower popularity, file a [http://bugs.alliedmods.net/index.php?project=5&do=index feature request].
  
:{| cellpadding="4"
+
{| class="wikitable"
|- class="t2th"
+
|-
| Command
+
! Command
| Plugin
+
! Plugin
| Access
+
! Access
| Format
+
! Format
| Description
+
! Description
|- class="t2td"
+
|-
 
| sm_beacon
 
| sm_beacon
 
| funcommands
 
| funcommands
Line 149: Line 148:
 
| &lt;target>
 
| &lt;target>
 
| Adds a ring around each target, making them easily visible.
 
| Adds a ring around each target, making them easily visible.
|- class="t2td"
+
|-
 
| sm_burn
 
| sm_burn
 
| funcommands
 
| funcommands
Line 155: Line 154:
 
| &lt;target> [time]
 
| &lt;target> [time]
 
| Sets the target(s) on fire for the specified amount of time.  This may or may not work fully on certain games (for example, TF2 is missing the fire sprite, but clients will bleed/lose health).  If specified, burning effect will stop after the [time] seconds.
 
| Sets the target(s) on fire for the specified amount of time.  This may or may not work fully on certain games (for example, TF2 is missing the fire sprite, but clients will bleed/lose health).  If specified, burning effect will stop after the [time] seconds.
|- class="t2td"
+
|-
 
| sm_chat
 
| sm_chat
 
| basechat
 
| basechat
Line 161: Line 160:
 
| &lt;message>
 
| &lt;message>
 
| Sends a say-chat message to all admins.
 
| Sends a say-chat message to all admins.
|- class="t2td"
+
|-
 
| sm_csay
 
| sm_csay
 
| basechat
 
| basechat
Line 167: Line 166:
 
| &lt;message>
 
| &lt;message>
 
| Sends a centered message to all players.
 
| Sends a centered message to all players.
|- class="t2td"
+
|-
 
| sm_gag
 
| sm_gag
 
| basecomm
 
| basecomm
Line 173: Line 172:
 
| &lt;target>
 
| &lt;target>
 
| Prevents the target(s) from using messagemode/say chat.
 
| Prevents the target(s) from using messagemode/say chat.
|- class="t2td"
+
|-
 
| sm_hsay
 
| sm_hsay
 
| basechat
 
| basechat
Line 179: Line 178:
 
| &lt;message>
 
| &lt;message>
 
| Sends a message to all players via a center-bottom hint box.
 
| Sends a message to all players via a center-bottom hint box.
|- class="t2td"
+
|-
 
| sm_msay
 
| sm_msay
 
| basechat
 
| basechat
Line 185: Line 184:
 
| &lt;message>
 
| &lt;message>
 
| Sends a message as a menu panel (only meaningful on games that support radio menus).
 
| Sends a message as a menu panel (only meaningful on games that support radio menus).
|- class="t2td"
+
|-
 
| sm_mute
 
| sm_mute
 
| basecomm
 
| basecomm
Line 191: Line 190:
 
| &lt;target>
 
| &lt;target>
 
| Prevents the target(s) from using voice chat.
 
| Prevents the target(s) from using voice chat.
|- class="t2td"
+
|-
 
| sm_play
 
| sm_play
 
| sounds
 
| sounds
Line 197: Line 196:
 
| &lt;target> &lt;file>
 
| &lt;target> &lt;file>
 
| Plays a sound file on the server to each target.
 
| Plays a sound file on the server to each target.
|- class="t2td"
+
|-
 
| sm_psay
 
| sm_psay
 
| basechat
 
| basechat
Line 203: Line 202:
 
| &lt;target> <message>
 
| &lt;target> <message>
 
| Sends a private chat message to a single target.
 
| Sends a private chat message to a single target.
|- class="t2td"
+
|-
 
| sm_rename
 
| sm_rename
 
| playercommands
 
| playercommands
Line 209: Line 208:
 
| <nowiki><#userid|name></nowiki>
 
| <nowiki><#userid|name></nowiki>
 
| Changes the name of a player.
 
| Changes the name of a player.
|- class="t2td"
+
|-
 
| sm_resetcvar
 
| sm_resetcvar
 
| basecommands
 
| basecommands
Line 215: Line 214:
 
| <nowiki><cvar></nowiki>
 
| <nowiki><cvar></nowiki>
 
| Resets CVAR value back to default.
 
| Resets CVAR value back to default.
|- class="t2td"
+
|-
 
| sm_say
 
| sm_say
 
| basechat
 
| basechat
Line 221: Line 220:
 
| &lt;message>
 
| &lt;message>
 
| Sends a say-chat message to all players.
 
| Sends a say-chat message to all players.
|- class="t2td"
+
|-
 
| sm_silence
 
| sm_silence
 
| basecomm
 
| basecomm
Line 227: Line 226:
 
| &lt;target>
 
| &lt;target>
 
| Performs both a gag and mute on the target(s).
 
| Performs both a gag and mute on the target(s).
|- class="t2td"
+
|-
 
| sm_slap
 
| sm_slap
 
| playercommands
 
| playercommands
Line 233: Line 232:
 
| &lt;target> [damage]
 
| &lt;target> [damage]
 
| "Slaps" a player, emitting a noise and throwing them in a random direction.  If specified, the damage amount will be subtracted from each target's health.
 
| "Slaps" a player, emitting a noise and throwing them in a random direction.  If specified, the damage amount will be subtracted from each target's health.
|- class="t2td"
+
|-
 
| sm_slay
 
| sm_slay
 
| playercommands
 
| playercommands
Line 239: Line 238:
 
| &lt;target>  
 
| &lt;target>  
 
| Kills a player.
 
| Kills a player.
|- class="t2td"
+
|-
 
| sm_tsay
 
| sm_tsay
 
| basechat
 
| basechat
Line 245: Line 244:
 
| [color] &lt;message>
 
| [color] &lt;message>
 
| Sends a top-left message to all players.  If no color is specified, the text will be white.  Colors available are: white, red, green, blue, yellow, purple, cyan, orange, pink, olive, lime, violet, lightblue.  The names are not case sensitive.
 
| Sends a top-left message to all players.  If no color is specified, the text will be white.  Colors available are: white, red, green, blue, yellow, purple, cyan, orange, pink, olive, lime, violet, lightblue.  The names are not case sensitive.
|- class="t2td"
+
|-
 
| sm_ungag
 
| sm_ungag
 
| basecomm
 
| basecomm
Line 251: Line 250:
 
| &lt;target>
 
| &lt;target>
 
| Allows the target(s) to use messagemode/say chat again.
 
| Allows the target(s) to use messagemode/say chat again.
|- class="t2td"
+
|-
 
| sm_unmute
 
| sm_unmute
 
| basecomm
 
| basecomm
Line 257: Line 256:
 
| &lt;target>
 
| &lt;target>
 
| Allows the target(s) to use voice chat again.
 
| Allows the target(s) to use voice chat again.
|- class="t2td"
+
|-
 
| sm_unsilence
 
| sm_unsilence
 
| basecomm
 
| basecomm
Line 268: Line 267:
 
These commands are listed separately as they are all related to voting.  None of them are available in war mode by default.
 
These commands are listed separately as they are all related to voting.  None of them are available in war mode by default.
  
:{| cellpadding="4"
+
{| class="wikitable"
|- class="t2th"
+
|-
| Command
+
! Command
| Plugin
+
! Plugin
| Access
+
! Access
| Format
+
! Format
| Description
+
! Description
|- class="t2td"
+
|-
 
| sm_vote
 
| sm_vote
 
| basevotes
 
| basevotes
 
| vote
 
| vote
 
| &lt;question> [answer1] [answer2] [answer3] ...
 
| &lt;question> [answer1] [answer2] [answer3] ...
| Starts an arbitrary vote with the given arguments as answers.
+
| Starts an arbitrary vote with the given arguments as answers. If no answer parameters are supplied, the answer options will be Yes and No localized into each client's language.
|- class="t2td"
+
|-
 
| sm_votealltalk
 
| sm_votealltalk
 
| funvotes
 
| funvotes
Line 287: Line 286:
 
|  
 
|  
 
| Starts a vote to change the value of sv_alltalk.
 
| Starts a vote to change the value of sv_alltalk.
|- class="t2td"
+
|-
 
| sm_voteban
 
| sm_voteban
 
| basevotes
 
| basevotes
Line 293: Line 292:
 
| &lt;target> [reason]
 
| &lt;target> [reason]
 
| Starts a vote to ban a single player for thirty minutes.
 
| Starts a vote to ban a single player for thirty minutes.
|- class="t2td"
+
|-
 
| sm_voteburn
 
| sm_voteburn
 
| funvotes
 
| funvotes
Line 299: Line 298:
 
| &lt;target>
 
| &lt;target>
 
| Starts a vote to burn a single player.
 
| Starts a vote to burn a single player.
|- class="t2td"
+
|-
 
| sm_voteff
 
| sm_voteff
 
| funvotes
 
| funvotes
Line 305: Line 304:
 
|  
 
|  
 
| Starts a vote to change the value of mp_friendlyfire.
 
| Starts a vote to change the value of mp_friendlyfire.
|- class="t2td"
+
|-
 
| sm_votegravity
 
| sm_votegravity
 
| funvotes
 
| funvotes
Line 311: Line 310:
 
| &lt;amount> [amount2] [amount3] ...
 
| &lt;amount> [amount2] [amount3] ...
 
| Initiates a vote to change the value of sv_gravity.
 
| Initiates a vote to change the value of sv_gravity.
|- class="t2td"
+
|-
 
| sm_votekick
 
| sm_votekick
 
| basevotes
 
| basevotes
Line 317: Line 316:
 
| &lt;target> [reason]
 
| &lt;target> [reason]
 
| Starts a vote to kick a single player.
 
| Starts a vote to kick a single player.
|- class="t2td"
+
|-
 
| sm_votemap
 
| sm_votemap
 
| basevotes
 
| basevotes
Line 323: Line 322:
 
| &lt;map> [map2] [map3] ...
 
| &lt;map> [map2] [map3] ...
 
| Starts a vote to change the map.
 
| Starts a vote to change the map.
|- class="t2td"
+
|-
 
| sm_voteslay
 
| sm_voteslay
 
| funvotes
 
| funvotes

Revision as of 13:09, 29 May 2014

This page lists all of the major admin commands in SourceMod.

Chat Triggers: Remember that commands do not have to be entered through the console; they can be entered via chat triggers. For example, saying "!ban bail" in chat will execute the same command as "sm_ban" and forward the output to chat. You can also use "/" instead of "!" to suppress your command from being shown to users.

How to Target

General targets:

  • name - Exact name match, or partial name match (if the partial string is unique).
  • #userid - If userid is numeric, the player will be targeted by their userid (found via the "users" command).
  • #steamid - Matches by Steam ID. If you use colons (:), you must enclose in quotes. Otherwise, you can use an underscore (_) instead. Examples: "#STEAM_0:1:4433", #STEAM_0_1_4433
  • #<name> - Exact name match after the # sign.
  • @all - All players (available on most commands).
  • @bots - All bots (available on most commands).
  • @alive - All alive players (available on most commands that accept alive players).
  • @dead - All dead players (available on most commands that accept dead players).
  • @humans - All non-bot players (available on most commands).
  • @aim - Current player the admin is directly aiming at.
  • @me - Target self.
  • @!me - Target everyone but yourself.

Note that name matches occur last, "magic targets" (such as # and @) are processed first. This means that "@all" will target @all players, even if there is a player named "@all". You should target "#@all" instead.

Counter-Strike only:

  • @ct or @cts - All Counter-Terrorists
  • @t or @ts - All Terrorists

Team Fortress 2 Only:

  • @red - All RED team members
  • @blue - All BLU team members


Basic Commands

These are basic commands found in plugins that have been deemed safe for War Mode; they provide simple functionality for administering your server.

Command Plugin Access Format Description
sm_addban basebans rcon Adds a Steam ID to Source's ban list.
sm_admin adminmenu admin Displays the admin menu.
sm_ban basebans ban <#userid|name> <minutes|0> [reason] Bans a client.
sm_banip basebans ban <ip|#userid|name> <time> [reason] Adds an IP address to Source's ban list. Only someone with rcon access can ban an arbitrary IP.
sm_cancelvote basecommands vote Cancels any vote in progress.
sm_cvar basecommands cvar <cvar> [value] Retrieves or changes a cvar value. Protected cvars can only be accessed with password access, and sv_cheats can only be accessed with cheat access. To add a cvar to the protected list (which by default contains all cvars flagged PROTECTED, rcon_password, sm_show_activity, and sm_immunity_mode), use sm_cvar protect <name>.
sm_execcfg basecommands config <filename> Executes a config file (path not needed, but extension is).
sm_help adminhelp admin search] Lists all admin commands. Output is paginated and a page number can be specified. Alternately, a search term can be specified to search for a specific command.
sm_kick basecommands kick <#userid|name> [reason] Kicks a player.
sm_map basecommands map <map> Changes the current map.
sm_rcon basecommands rcon <argstring> Executes the argument string via rcon. You will only see RCON output on SourceMod 1.4 or above.
sm_reloadadmins basecommands config Refreshes the Admin cache from all sources.
sm_unban basebans unban <steamid|ip> Unbans a Steam ID or an IP.
sm_who basecommands admin [#userid|name] Lists all users and their access rights, or a specific user's access rights.

Extended Commands

These commands provide extended functionality that may not be present on all games, either due to game or engine differences. In general, they work on the most popular mods. If you have a mod which is new, or not supported yet due to lower popularity, file a feature request.

Command Plugin Access Format Description
sm_beacon funcommands slay <target> Adds a ring around each target, making them easily visible.
sm_burn funcommands slay <target> [time] Sets the target(s) on fire for the specified amount of time. This may or may not work fully on certain games (for example, TF2 is missing the fire sprite, but clients will bleed/lose health). If specified, burning effect will stop after the [time] seconds.
sm_chat basechat chat <message> Sends a say-chat message to all admins.
sm_csay basechat chat <message> Sends a centered message to all players.
sm_gag basecomm chat <target> Prevents the target(s) from using messagemode/say chat.
sm_hsay basechat chat <message> Sends a message to all players via a center-bottom hint box.
sm_msay basechat chat <message> Sends a message as a menu panel (only meaningful on games that support radio menus).
sm_mute basecomm chat <target> Prevents the target(s) from using voice chat.
sm_play sounds admin <target> <file> Plays a sound file on the server to each target.
sm_psay basechat chat <target> <message> Sends a private chat message to a single target.
sm_rename playercommands slay <#userid|name> Changes the name of a player.
sm_resetcvar basecommands cvar <cvar> Resets CVAR value back to default.
sm_say basechat chat <message> Sends a say-chat message to all players.
sm_silence basecomm chat <target> Performs both a gag and mute on the target(s).
sm_slap playercommands slay <target> [damage] "Slaps" a player, emitting a noise and throwing them in a random direction. If specified, the damage amount will be subtracted from each target's health.
sm_slay playercommands slay <target> Kills a player.
sm_tsay basechat chat [color] <message> Sends a top-left message to all players. If no color is specified, the text will be white. Colors available are: white, red, green, blue, yellow, purple, cyan, orange, pink, olive, lime, violet, lightblue. The names are not case sensitive.
sm_ungag basecomm chat <target> Allows the target(s) to use messagemode/say chat again.
sm_unmute basecomm chat <target> Allows the target(s) to use voice chat again.
sm_unsilence basecomm chat <target> Perfoms both an ungag and unmute on the target(s).

Vote Commands

These commands are listed separately as they are all related to voting. None of them are available in war mode by default.

Command Plugin Access Format Description
sm_vote basevotes vote <question> [answer1] [answer2] [answer3] ... Starts an arbitrary vote with the given arguments as answers. If no answer parameters are supplied, the answer options will be Yes and No localized into each client's language.
sm_votealltalk funvotes vote Starts a vote to change the value of sv_alltalk.
sm_voteban basevotes vote, ban <target> [reason] Starts a vote to ban a single player for thirty minutes.
sm_voteburn funvotes vote, slay <target> Starts a vote to burn a single player.
sm_voteff funvotes vote Starts a vote to change the value of mp_friendlyfire.
sm_votegravity funvotes vote <amount> [amount2] [amount3] ... Initiates a vote to change the value of sv_gravity.
sm_votekick basevotes vote, kick <target> [reason] Starts a vote to kick a single player.
sm_votemap basevotes vote, map <map> [map2] [map3] ... Starts a vote to change the map.
sm_voteslay funvotes vote, slay <target> Starts a vote to slay a single player.