summaryrefslogtreecommitdiff
path: root/src/game/g_admin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r--src/game/g_admin.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index c46deab..61e0c1c 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -1380,9 +1380,21 @@ static void admin_log( gentity_t *admin, char *cmd, int skiparg )
int pids[ MAX_CLIENTS ];
char name[ MAX_NAME_LENGTH ];
- if( !g_adminLog.string[ 0 ] )
- return ;
+ if ( !Q_stricmp( cmd, "attempted" ) )
+ {
+ Com_sprintf( string, sizeof( string ),
+ "%s^7 (%i) %s: %s",
+ ( admin ) ? admin->client->pers.netname : "console",
+ ( admin ) ? admin->s.clientNum : -1,
+ cmd,
+ G_SayConcatArgs( 1 + skiparg ) );
+ G_AdminsPrintf("%s\n",string);
+ }
+ G_LogPrintf("Admin Command: %s^7 (%s): %s %s\n",( admin ) ? admin->client->pers.netname : "console", ( admin ) ? admin->client->pers.adminName : "console", cmd, G_SayConcatArgs( 1 + skiparg ));
+
+ if( !g_adminLog.string[ 0 ] )
+ return;
len = trap_FS_FOpenFile( g_adminLog.string, &f, FS_APPEND );
if( len < 0 )
@@ -1475,19 +1487,6 @@ static void admin_log( gentity_t *admin, char *cmd, int skiparg )
trap_FS_Write( string, strlen( string ), f );
}
trap_FS_FCloseFile( f );
-
- if ( !Q_stricmp( cmd, "attempted" ) )
- {
- Com_sprintf( string, sizeof( string ),
- "%s^7 (%i) %s: %s",
- ( admin ) ? admin->client->pers.netname : "console",
- ( admin ) ? admin->s.clientNum : -1,
- cmd,
- G_SayConcatArgs( 1 + skiparg ) );
- G_AdminsPrintf("%s\n",string);
- }
-
- G_LogPrintf("Admin Command: %s^7 (%s): %s %s\n",( admin ) ? admin->client->pers.netname : "console", ( admin ) ? admin->client->pers.adminName : "console", cmd, G_SayConcatArgs( 1 + skiparg ));
}
static int admin_listadmins( gentity_t *ent, int start, char *search, int minlevel )