Fixing the stuff cmd to work on dedicated servers.

This commit is contained in:
Richard Allen 2002-05-04 16:19:02 +00:00
parent d514faeb74
commit 1c6ac9090e
4 changed files with 23 additions and 8 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.102 2002/05/04 16:19:02 jbravo
// Fixing the stuff cmd to work on dedicated servers.
//
// Revision 1.101 2002/05/01 18:44:36 jbravo // Revision 1.101 2002/05/01 18:44:36 jbravo
// Added a stuff command. Needed for misc things. See bottum of cmd_use in // Added a stuff command. Needed for misc things. See bottum of cmd_use in
// g_teamplay.c // g_teamplay.c
@ -2907,8 +2910,6 @@ void ClientCommand( int clientNum ) {
// JBravo: adding tkok // JBravo: adding tkok
else if (Q_stricmp (cmd, "tkok") == 0) else if (Q_stricmp (cmd, "tkok") == 0)
RQ3_Cmd_TKOk (ent); RQ3_Cmd_TKOk (ent);
else if (Q_stricmp (cmd, "stuff") == 0)
RQ3_Cmd_Stuff (ent);
//Elder: stuff for dropping items //Elder: stuff for dropping items
else if (Q_stricmp (cmd, "dropitem") == 0) else if (Q_stricmp (cmd, "dropitem") == 0)
Cmd_DropItem_f( ent ); Cmd_DropItem_f( ent );

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.8 2002/05/04 16:19:02 jbravo
// Fixing the stuff cmd to work on dedicated servers.
//
// Revision 1.7 2002/04/03 15:51:01 jbravo // Revision 1.7 2002/04/03 15:51:01 jbravo
// Small warning fixes // Small warning fixes
// //
@ -25,7 +28,7 @@
// this file holds commands that can be executed by the server console, but not remote clients // this file holds commands that can be executed by the server console, but not remote clients
#include "g_local.h" #include "g_local.h"
#include "g_teamplay.h"
/* /*
============================================================================== ==============================================================================
@ -461,6 +464,12 @@ qboolean ConsoleCommand( void ) {
return qtrue; return qtrue;
} }
// JBravo: adding a stuff cmd.
if (Q_stricmp (cmd, "stuff") == 0) {
RQ3_Cmd_Stuff();
return qtrue;
}
if (Q_stricmp (cmd, "listip") == 0) { if (Q_stricmp (cmd, "listip") == 0) {
trap_SendConsoleCommand( EXEC_NOW, "g_banIPs\n" ); trap_SendConsoleCommand( EXEC_NOW, "g_banIPs\n" );
return qtrue; return qtrue;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.76 2002/05/04 16:19:02 jbravo
// Fixing the stuff cmd to work on dedicated servers.
//
// Revision 1.75 2002/05/04 16:13:05 makro // Revision 1.75 2002/05/04 16:13:05 makro
// Bots // Bots
// //
@ -1755,20 +1758,20 @@ void RQ3_Cmd_TKOk (gentity_t *ent)
ent->enemy = NULL; ent->enemy = NULL;
} }
void RQ3_Cmd_Stuff (gentity_t *ent) void RQ3_Cmd_Stuff (void)
{ {
char *cmd, user[128]; char *cmd, user[128];
int len, client; int len, client;
len = trap_Argc (); len = trap_Argc ();
if (len < 3) { if (len < 3) {
trap_SendServerCommand(ent-g_entities, va("print \"Usage: stuff <user id> <text>\n\"")); G_Printf ("Usage: stuff <user id> <text>\n");
return; return;
} }
trap_Argv(1, user, sizeof(user)); trap_Argv(1, user, sizeof(user));
if (user[0] < '0' || user[0] > '9') { if (user[0] < '0' || user[0] > '9') {
trap_SendServerCommand(ent-g_entities, va("print \"Usage: stuff <user id> <text>\n\"")); G_Printf ("Usage: stuff <user id> <text>\n");
return; return;
} }
client = atoi (user); client = atoi (user);
@ -1776,4 +1779,3 @@ void RQ3_Cmd_Stuff (gentity_t *ent)
trap_SendServerCommand(client, va("stuff %s\n", cmd)); trap_SendServerCommand(client, va("stuff %s\n", cmd));
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.14 2002/05/04 16:19:02 jbravo
// Fixing the stuff cmd to work on dedicated servers.
//
// Revision 1.13 2002/05/01 18:44:36 jbravo // Revision 1.13 2002/05/01 18:44:36 jbravo
// Added a stuff command. Needed for misc things. See bottum of cmd_use in // Added a stuff command. Needed for misc things. See bottum of cmd_use in
// g_teamplay.c // g_teamplay.c
@ -84,6 +87,6 @@ void ParseSayText (gentity_t * ent, char *text);
void RQ3_SpectatorMode(gentity_t *ent); void RQ3_SpectatorMode(gentity_t *ent);
void Add_TeamKill(gentity_t *attacker); void Add_TeamKill(gentity_t *attacker);
void RQ3_Cmd_TKOk(gentity_t *ent); void RQ3_Cmd_TKOk(gentity_t *ent);
void RQ3_Cmd_Stuff(gentity_t *ent); void RQ3_Cmd_Stuff(void);
void Add_TeamWound(gentity_t *attacker, gentity_t *victim, int mod); void Add_TeamWound(gentity_t *attacker, gentity_t *victim, int mod);
void setFFState(gentity_t *ent); void setFFState(gentity_t *ent);