Jump to content

Home

Commands?


XSeth2kX

Recommended Posts

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

/*

=================

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

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

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 :yoda:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...