Console Commands -1 reply

  • 1
  • 2

Please wait...

heath1992

A well-oiled toaster oven

50 XP

26th January 2007

0 Uploads

298 Posts

0 Threads

#11 10 years ago
Dreydahh;4979020Yeah, in g_main i found what i want, omg i dont know how i could missed it

Those are server vars. What you're probably looking for are client commands ("noclip", "god", "kill", etc). You'll find those in 'g_cmds.c'. I suggest starting at the 'void ClientCommand(int clientNum)' function.

To SuperSonic12: You don't edit the .dll's. Compiling the source code creates new .dll's for you to use.




Raz0r

Worse than most terrible

50 XP

27th September 2006

0 Uploads

6,737 Posts

0 Threads

#12 10 years ago

Also note, not every command is handled by the source we have. Some are in the engine (EG: timescale)




Guest

I didn't make it!

0 XP

 
#13 10 years ago

To make a new command for Multiplayer go into your g_cmds.c and go to the lines: //rww - redirect bot commands if (strstr(cmd, "bot_") && AcceptBotCommand(cmd, ent)) { return; } //end rww (this is just where i put my commands at) After that hit return and thar you can start you own commands a example of a command is

if(Q_stricmp(cmd, "modinfo") == 0) { //modinfo is the command. trap_SendServerCommand(ent->s.number, "cp \"^7Knights of the new ^4Republic ^4v1.0 ^4BETA\n\""); //this will send the command to your screen for console replace cp with print return;//finishes the command make sure you have this or it wont work properly } the next exmaple of a command is a little more advacned. this command will show the name of whoever used it on thier console if(Q_stricmp(cmd, "example") == 0) { //example is the cmd trap_SendServerCommand(ent-g_entities, va("print \"%s\n\"", ent->client->pers.netname)); //this will show whoever used the cmd's name on your console %s uses whatever is after the comma(ent->client->pers.netname) return; } note: some things use %i instead of %s

if you(or anyone) need help on coding my msn is [email]cheesehead1995@hotmail.com[/email]

EDIT: @sonic your not supposed to be able to open .dlls. its a security mesuare so noone takes your code




Raz0r

Worse than most terrible

50 XP

27th September 2006

0 Uploads

6,737 Posts

0 Threads

#14 10 years ago
Taren;4980346@sonic your not supposed to be able to open .dlls. its a security mesuare so noone takes your code

Actually, the code is compiled into a file format that you decide. In this case, we're talking about a 'Dynamic Library' Basically, it chomps down all of the english that we see right down into pure machine code your computer can understand. It's not security, it's usability.




Guest

I didn't make it!

0 XP

 
#15 10 years ago

i know that razor. but compiling it into a dll is a security mesuare. Some people dun compile for linux(such as rohobo) cause you cant secure it like .dlls




heath1992

A well-oiled toaster oven

50 XP

26th January 2007

0 Uploads

298 Posts

0 Threads

#16 10 years ago

You can decompile a .dll file as much as you can a .so file. Either way you'll get Assembly code. You lose all of the 3rd level coding.




  • 1
  • 2