/* ================= CG_InitConsoleCommands Let the client system know about all of our commands so it can perform tab completion ================= */ void CG_InitConsoleCommands( void ) { unsigned i; for ( i = 0; i < ARRAY_LEN( commands ); i++ ) { //Check that the commands are in increasing order so that it can be used by bsearch if ( i != 0 && strcmp(commands[i-1].cmd, commands[i].cmd) > 0 ) { CG_Printf( "CGame command list is in the wrong order for %s and %s\n", commands[i - 1].cmd, commands[i].cmd ); } trap_AddCommand( commands[ i ].cmd ); } trap_RegisterButtonCommands( // 0 12 3 45 6 78 9ABCDEF <- bit nos. "attack,,useitem,taunt,,sprint,activate,,attack2,,,,,,rally" ); }
/* ================= CG_InitConsoleCommands Let the client system know about all of our commands so it can perform tab completion ================= */ void CG_InitConsoleCommands( void ) { int i; for ( i = 0; i < ARRAY_LEN( commands ); i++ ) { trap_AddCommand( commands[ i ].cmd ); } // // the game server will interpret these commands, which will be automatically // forwarded to the server after they are not recognized locally // trap_AddCommand( "kill" ); trap_AddCommand( "ui_messagemode" ); trap_AddCommand( "ui_messagemode2" ); trap_AddCommand( "ui_messagemode3" ); trap_AddCommand( "ui_messagemode4" ); trap_AddCommand( "say" ); trap_AddCommand( "say_team" ); trap_AddCommand( "god" ); trap_AddCommand( "notarget" ); trap_AddCommand( "noclip" ); trap_AddCommand( "team" ); trap_AddCommand( "setviewpos" ); trap_AddCommand( "vote" ); trap_AddCommand( "teamvote" ); trap_AddCommand( "reload" ); trap_AddCommand( "destroy" ); trap_AddCommand( "deconstruct" ); trap_RegisterButtonCommands( // 0 12 3 45 6 78 9ABCDEF <- bit nos. "attack,,useitem,taunt,,sprint,activate,,attack2,,,,,,,dodge" ); }
/* ================= CG_InitConsoleCommands Let the client system know about all of our commands so it can perform tab completion ================= */ void CG_InitConsoleCommands() { static bool initialized = false; if (initialized) { return; } initialized = true; for ( unsigned i = 0; i < ARRAY_LEN( commands ); i++ ) { //Check that the commands are in increasing order so that it can be used by bsearch if ( i != 0 && Q_stricmp(commands[i-1].cmd, commands[i].cmd) > 0 ) { Log::Warn( "CGame command list is in the wrong order for %s and %s", commands[i - 1].cmd, commands[i].cmd ); } trap_AddCommand( commands[ i ].cmd ); } trap_RegisterButtonCommands( // 0 12 3 45 6 78 9ABCDEF <- bit nos. "attack,,useitem,taunt,,sprint,activate,,attack2,,,,,,rally" ); }