Garry's Mod Wiki

Revision Difference

Player:ConCommand#527366

<function name="ConCommand" parent="Player" type="classfunc"> <description> Runs the concommand on the player. This does not work on bots. If you wish to directly modify the movement input of bots, use <page>GM:StartCommand</page> instead. <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> <bug>On clientside running a ConCommand on an other player will not throw any warnings or errors but will run the ConCommand on LocalPlayer() instead.</bug>⤶ </description> <realm>Shared</realm> <args> <arg name="command" type="string">command to run</arg> </args> </function> <example> <description>Kills the player using the concommand</description> <code>Entity( 1 ):ConCommand( "kill" )</code> <output>The Player1 dies.</output> </example>