From 7309ee5dd3ba0b9a40705bc6373d867aea3a6f97 Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sat, 7 Mar 2020 20:56:38 +0000 Subject: add !practise command --- src/game/g_cmds.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'src/game/g_cmds.c') 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 ); -- cgit