Talk:Orange Box server plugins: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "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 autoc...")
 
No edit summary
 
Line 2: Line 2:


Instead, use this code to add console commands/vars:
Instead, use this code to add console commands/vars:
  ConCommand myCommand("my_command", myCommand_f, "My plugin's commands.", FCVAR_NONE, myCommand_completion_f);
  ConCommand myCommand("my_command", myCommand_f, "My plugin's command.", FCVAR_NONE, myCommand_completion_f);


and inside Load() function of your plugin do:
and inside Load() function of your plugin do:

Latest revision as of 17:49, 10 September 2012

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