Executing console commands: Difference between revisions
Jump to navigation
Jump to search
Steveukpwnz (talk | contribs) No edit summary |
Steveukpwnz (talk | contribs) mNo edit summary |
||
Line 5: | Line 5: | ||
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. | ||
== Executing command from client == | == Executing command from client == |
Revision as of 18:28, 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.
Executing command from client
If you want to execute a client command, on the client you would use engine->ClientCmd( "command" );
. Unlike the server-side one, this does not support formatting.