diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2019-08-25 17:30:51 +0100 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2019-08-25 17:30:51 +0100 |
commit | 3db203fdc9906d700507056b837364e000dc5a7c (patch) | |
tree | 785a3dc7c3e3131a1fdb861dc0642fa9a1d2dc63 /src/game/g_cmds.c | |
parent | 9fb9596cfa00676e94b69076d442091a23750f18 (diff) |
add scrim command
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 39ac73f..5ff0259 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -768,7 +768,14 @@ 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--; else if( oldteam == PTE_HUMANS ) @@ -992,7 +999,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( mode == SAY_HADMINS && @@ -1037,6 +1045,12 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ) 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; + } + // Spam limit: If they said this message recently, ignore it. if( g_spamTime.integer ) { @@ -1581,6 +1595,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 ) ); |