Executing console commands: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(New page: == 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...)
 
No edit summary
Line 1: Line 1:
== Executing command on client ==
== Executing command on client ==
If you wish to execute a console command on a client from the server use:
If you wish to execute a console command on a client from the server use:
<code>engine->ClientCommand( edict(), "command", ... );</code>
<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.
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.
[[Category:Snippets]]

Revision as of 18:25, 21 March 2009

Executing command on client

If you wish to execute a console command on a client from the server use: engine->ClientCommand( edict(), "command", ... ); 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.