diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-03-07 20:56:38 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-03-08 00:13:44 +0000 |
commit | 7309ee5dd3ba0b9a40705bc6373d867aea3a6f97 (patch) | |
tree | fdbeba64154a354a6ad75d7d2e002f9a58b1cd36 /src/game/g_cmds.c | |
parent | 888ea67bab11ba1a6917e3e4ff26bfc2e5233235 (diff) |
add !practise command
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index e4f6ad7..33771df 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -2742,14 +2742,17 @@ void Cmd_Class_f( gentity_t *ent ) if( ent->client->pers.teamSelection == PTE_ALIENS ) { - if( newClass != PCL_ALIEN_BUILDER0 && - newClass != PCL_ALIEN_BUILDER0_UPG && - newClass != PCL_ALIEN_LEVEL0 ) + if( !g_practise.integer ) { - trap_SendServerCommand( ent-g_entities, - va( "print \"You cannot spawn with class %s\n\"", s ) ); - return; - } + if( newClass != PCL_ALIEN_BUILDER0 && + newClass != PCL_ALIEN_BUILDER0_UPG && + newClass != PCL_ALIEN_LEVEL0 ) + { + trap_SendServerCommand( ent-g_entities, + va( "print \"You cannot spawn with class %s\n\"", s ) ); + return; + } + } if( !BG_ClassIsAllowed( newClass ) ) { @@ -3019,6 +3022,13 @@ void Cmd_Destroy_f( gentity_t *ent ) return; } + if( g_practise.integer ) + { + trap_SendServerCommand( ent-g_entities, + "print \"You cannot build in practise mode\n\"" ); + return; + } + trap_Argv( 0, cmd, sizeof( cmd ) ); if( Q_stricmp( cmd, "destroy" ) == 0 ) deconstruct = qfalse; @@ -3194,6 +3204,13 @@ void Cmd_Mark_f( gentity_t *ent ) return; } + if( g_practise.integer ) + { + trap_SendServerCommand( ent-g_entities, + "print \"You cannot build in practise mode\n\"" ); + return; + } + // Check the minimum level to deconstruct if ( G_admin_level( ent ) < g_minDeconLevel.integer && !ent->client->pers.designatedBuilder && g_minDeconAffectsMark.integer > 0 ) { @@ -3768,6 +3785,7 @@ void Cmd_Build_f( gentity_t *ent ) "print \"Your building rights have been revoked\n\"" ); return; } + if( ent->client->pers.paused ) { trap_SendServerCommand( ent-g_entities, @@ -3775,6 +3793,13 @@ void Cmd_Build_f( gentity_t *ent ) return; } + if( g_practise.integer ) + { + trap_SendServerCommand( ent-g_entities, + "print \"You cannot build in practise mode\n\"" ); + return; + } + trap_Argv( 1, s, sizeof( s ) ); buildable = BG_FindBuildNumForName( s ); |