XSeth2kX Posted December 12, 2002 Share Posted December 12, 2002 in g_active i have //mod #define FL_BOOTS 0x00006000 // Anti Gravity Boots //end mod and in g_cmds i have //Mod /* ================= Cmd_Msg_f ================= */ void Cmd_Cmd_Msg_f( gentity_t *ent ) { trap_SendServerCommand( client->ps.clientNum, "print "Test \n" S_COLOR_RED ); } /* ================= Cmd_Boots_f function for turning boots on/off ================= */ void Cmd_Boots_f( gentity_t *ent ) { char *msg; // message to player ent->flags ^= FL_BOOTS; if (!(ent->flags & FL_BOOTS)) msg = "Anti Gravity boots OFF\n"; else msg = "Anti Gravity boots ON\n"; trap_SendServerCommand( ent-g_entities, va("print \"%s\"", msg)); } //End Mod //Mod else if (Q_stricmp (cmd, "boots") == 0) Cmd_Boots_f( ent ); //End Mod //Mod else if (Q_stricmp (cmd, "msg") == 0) Cmd_Msg_f( ent ); //End Mod does it matter which line their on? when i try them them in game it says unknown command Link to comment Share on other sites More sharing options...
Tchouky Posted December 12, 2002 Share Posted December 12, 2002 did you write : /boots in the console or just : boots because you have to write the '/' if yes then i don't know, it seems fine... Link to comment Share on other sites More sharing options...
Wudan Posted December 12, 2002 Share Posted December 12, 2002 On that very very very last part, the boots and msg commands, those are in g_cmds.c, and they are surrounded by a ton of similar commands, right? Link to comment Share on other sites More sharing options...
XSeth2kX Posted December 12, 2002 Author Share Posted December 12, 2002 nm, i needed to add it to console commands file Link to comment Share on other sites More sharing options...
Code Posted December 12, 2002 Share Posted December 12, 2002 /* ================= Cmd_Msg_f ================= */ void Cmd_Cmd_Msg_f( .... didnt u mean Cmd_Msg_f because you have to write the '/' if u edit cgame/cg_consolecmds.c in the CG_InitConsoleCommands function add this line trap_AddCommand ("boots"); then u wont need the / in the console Link to comment Share on other sites More sharing options...
XSeth2kX Posted December 12, 2002 Author Share Posted December 12, 2002 Hmm it still isnt working Link to comment Share on other sites More sharing options...
Wudan Posted December 13, 2002 Share Posted December 13, 2002 no, it has to be in g_cmds.c I read the same tutorial that you are going off of. Link to comment Share on other sites More sharing options...
XSeth2kX Posted December 13, 2002 Author Share Posted December 13, 2002 it is Link to comment Share on other sites More sharing options...
Code Posted December 13, 2002 Share Posted December 13, 2002 trap_SendServerCommand( client->ps.clientNum, "print "Test \n" S_COLOR_RED ); and trap_SendServerCommand( ent-g_entities, va("print \"%s\"", msg)); not same type of argv u sure u didnt mean trap_SendServerCommand( ent->client->ps.clientNum, va("print \"%s\"", msg)); im quite sure u have an error in ent-g_entities hope this helps Link to comment Share on other sites More sharing options...
XSeth2kX Posted December 14, 2002 Author Share Posted December 14, 2002 nothing. I give up ive added the commands and still noting Link to comment Share on other sites More sharing options...
Code Posted December 15, 2002 Share Posted December 15, 2002 if u edit cgame/cg_consolecmds.c in the CG_InitConsoleCommands function add this line trap_AddCommand ("boots"); then u wont need the / in the console i did that of course then i 'tested' it in game/cmds.c else if (Q_stricmp (cmd, "boots") == 0) { ent->flags ^= FL_BOOTS; if (!(ent->flags & FL_BOOTS)) { trap_SendServerCommand( clientNum, va("print \"^3Gravity Boots OFF^7\n\"" ) ); } else { trap_SendServerCommand( clientNum, va("print \"^3Gravity Boots ON^7\n\"" ) ); } } of course i added the flag also #define FL_BOOTS 0x00010000 I give up how to make a mod 101 1st - dont give up hey im a n00b !!! lol May the Force b with you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.