Talk:Orange Box server plugins

From Valve Developer Community
Revision as of 17:49, 10 September 2012 by Borzh62 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

OK, for those who are developing plugins, it is not really necessary to implement IConCommandBaseAccessor and use ConVar_Register, your console command will never appear in autocomplete list.

Instead, use this code to add console commands/vars:

ConCommand myCommand("my_command", myCommand_f, "My plugin's command.", FCVAR_NONE, myCommand_completion_f);

and inside Load() function of your plugin do:

pCvar->RegisterConCommand( &myCommand); // Of course your pCvar should be initialized before.


and inside UnLoad() function of your plugin do:

pCvar->UnregisterConCommand( &myCommand);

--borzh62 10 Sept 2012