Executing console commands: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Redirecting this page to Developer_Console_Control as the same info can be found there)
(Replaced content with "#REDIRECT Developer_Console_Control#Executing_commands")
 
Line 1: Line 1:
#REDIRECT [[Developer_Console_Control#Executing_commands]]
#REDIRECT [[Developer_Console_Control#Executing_commands]]
{{orphan}}
== Executing command on client ==
If you wish to execute a console command on a client from the server use:
<code>engine->ClientCommand( edict(), "command", ... );</code>
Where edict() is your ent's edict, "command" would be replaced by your concommand, followed by any formatted vars (same as printf). This would be useful for showing a team selection menu.
== Executing command from client ==
If you want to execute a client command, on the client you would use <code>engine->ClientCmd( "command" );</code>. Unlike the server-side one, this does not support formatting.
[[Category:Snippets]]

Latest revision as of 08:51, 3 November 2011