From: terencehill Date: Thu, 20 Oct 2011 21:29:25 +0000 (+0200) Subject: If g_changeteam_banned is set and the player tries to switch team just sprint the... X-Git-Tag: xonotic-v0.6.0~74^2~110^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=21fa23d99cc1681d82cba30f14026c648e1a3bdf;p=xonotic%2Fxonotic-data.pk3dir.git If g_changeteam_banned is set and the player tries to switch team just sprint the msg "^1You cannot change team, forbidden by the server.\n" instead of killing him. --- diff --git a/qcsrc/server/clientcommands.qc b/qcsrc/server/clientcommands.qc index 2ffa4afd9..5ac39b71e 100644 --- a/qcsrc/server/clientcommands.qc +++ b/qcsrc/server/clientcommands.qc @@ -277,25 +277,33 @@ void SV_ParseClientCommand(string s) { } else if(lockteams) { sprint( self, "^7The game has already begun, you must wait until the next map to be able to join a team.\n"); } else if( argv(1) == "red" ) { - if(self.team != COLOR_TEAM1 || self.deadflag != DEAD_NO) - ClientKill_TeamChange(COLOR_TEAM1); - else + if(self.team == COLOR_TEAM1 && self.deadflag == DEAD_NO) sprint( self, "^7You already are on that team.\n"); - } else if( argv(1) == "blue" ) { - if(self.team != COLOR_TEAM2 || self.deadflag != DEAD_NO) - ClientKill_TeamChange(COLOR_TEAM2); + else if (self.wasplayer && autocvar_g_changeteam_banned) + sprint( self, "^1You cannot change team, forbidden by the server.\n"); else + ClientKill_TeamChange(COLOR_TEAM1); + } else if( argv(1) == "blue" ) { + if(self.team == COLOR_TEAM2 && self.deadflag == DEAD_NO) sprint( self, "^7You already are on that team.\n"); - } else if( argv(1) == "yellow" ) { - if(self.team != COLOR_TEAM3 || self.deadflag != DEAD_NO) - ClientKill_TeamChange(COLOR_TEAM3); + else if (self.wasplayer && autocvar_g_changeteam_banned) + sprint( self, "^1You cannot change team, forbidden by the server.\n"); else + ClientKill_TeamChange(COLOR_TEAM2); + } else if( argv(1) == "yellow" ) { + if(self.team == COLOR_TEAM3 && self.deadflag == DEAD_NO) sprint( self, "^7You already are on that team.\n"); - } else if( argv(1) == "pink" ) { - if(self.team != COLOR_TEAM4 || self.deadflag != DEAD_NO) - ClientKill_TeamChange(COLOR_TEAM4); + else if (self.wasplayer && autocvar_g_changeteam_banned) + sprint( self, "^1You cannot change team, forbidden by the server.\n"); else + ClientKill_TeamChange(COLOR_TEAM3); + } else if( argv(1) == "pink" ) { + if(self.team == COLOR_TEAM4 && self.deadflag == DEAD_NO) sprint( self, "^7You already are on that team.\n"); + else if (self.wasplayer && autocvar_g_changeteam_banned) + sprint( self, "^1You cannot change team, forbidden by the server.\n"); + else + ClientKill_TeamChange(COLOR_TEAM4); } else if( argv(1) == "auto" ) { ClientKill_TeamChange(-1); } else {