Revision Difference
Global.RunConsoleCommand#568442
<function name="RunConsoleCommand" parent="Global" type="libraryfunc">
<description>
Executes the given console command with the parameters.
Executes the given <page text="console command">Console_commands</page> with the parameters.
⤶
Will be ran on the local client if used clientside, will run on the server if ran serverside. Keep in mind that the server and client are one and the same in singleplayer and for listen server hosts.⤶
<note>Some commands/convars are blocked from being ran/changed using this function, usually to prevent harm/annoyance to clients. For a list of blocked commands, see <page>Blocked ConCommands</page>.</note>
</description>
<realm>Shared and Menu</realm>
<args>
<arg name="command" type="string">The command to be executed.</arg>
<arg name="arguments" type="vararg">The arguments. Note, that unlike <page>Player:ConCommand</page>, you must pass each argument as a new string, not separating them with a space.</arg>
</args>
</function>
<example>
<description>Changes the gravity to 400 (default 600).</description>
<code>RunConsoleCommand("sv_gravity", "400")</code>
</example>
Garry's Mod
Rust
Steamworks
Wiki Help