summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 723a2a5..9b49010 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -777,6 +777,13 @@ void Cmd_Team_f( gentity_t *ent )
va( "print \"You cannot join a team while invisible\n\"" ) );
return;
}
+
+ if( g_scrimMode.integer != 0 && !G_admin_permission( ent, ADMF_NOSCRIMRESTRICTION ) )
+ {
+ trap_SendServerCommand( ent-g_entities,
+ va( "print \"You can't join a team when scrim mode is enabled\n\"" ) );
+ return;
+ }
if( oldteam == PTE_ALIENS )
aliens--;
@@ -1017,7 +1024,8 @@ static void G_SayTo( gentity_t *ent, gentity_t *other, int mode, int color, cons
}
if( mode == SAY_ADMINS &&
- (!G_admin_permission( other, ADMF_ADMINCHAT) || other->client->pers.ignoreAdminWarnings ) )
+ (!G_admin_permission( other, ADMF_ADMINCHAT) || other->client->pers.ignoreAdminWarnings ||
+ ( g_scrimMode.integer != 0 && !G_admin_permission( ent, ADMF_NOSCRIMRESTRICTION ) ) ) )
return;
if( BG_ClientListTest( &other->client->sess.ignoreList, ent-g_entities ) )
@@ -1054,6 +1062,12 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
trap_SendServerCommand( ent-g_entities, "print \"You cannot chat while invisible\n\"" );
return;
}
+
+ if( ent && ent->client->pers.teamSelection == PTE_NONE && g_scrimMode.integer != 0 && !G_admin_permission( ent, ADMF_NOSCRIMRESTRICTION ) && mode != SAY_TEAM )
+ {
+ trap_SendServerCommand( ent-g_entities, "print \"You can't chat when scrim mode is enabled.\n\"" );
+ return;
+ }
// Flood limit. If they're talking too fast, determine that and return.
if( g_floodMinTime.integer )
@@ -1811,6 +1825,14 @@ void Cmd_CallVote_f( gentity_t *ent )
return;
}
+ if( !G_admin_permission( ent, ADMF_NOSCRIMRESTRICTION ) && g_scrimMode.integer != 0 &&
+ ent->client->pers.teamSelection == PTE_NONE )
+ {
+ trap_SendServerCommand( ent - g_entities,
+ "print \"You can't call votes when scrim mode is enabled\n\"" );
+ return;
+ }
+
// make sure it is a valid command to vote on
trap_Argv( 1, arg1, sizeof( arg1 ) );
trap_Argv( 2, arg2, sizeof( arg2 ) );