mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 15:17:57 -05:00
Add grief teams fix
This commit is contained in:
50
scripts/zm/_zm_reimagined_grief.gsc
Normal file
50
scripts/zm/_zm_reimagined_grief.gsc
Normal file
@ -0,0 +1,50 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\zombies\_zm_utility;
|
||||
#include maps\mp\gametypes_zm\_hud_util;
|
||||
#include maps\mp\gametypes_zm\_hud_message;
|
||||
|
||||
init()
|
||||
{
|
||||
if ( getDvar( "g_gametype" ) != "zgrief" )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
level thread on_player_connect();
|
||||
|
||||
if ( getDvarInt( "zombies_minplayers" ) < 2 || getDvarInt( "zombies_minplayers" ) == "" )
|
||||
{
|
||||
setDvar( "zombies_minplayers", 2 );
|
||||
}
|
||||
}
|
||||
|
||||
on_player_connect()
|
||||
{
|
||||
while ( 1 )
|
||||
{
|
||||
level waittill( "connected", player );
|
||||
player set_team();
|
||||
player [[ level.givecustomcharacters ]]();
|
||||
}
|
||||
}
|
||||
|
||||
set_team()
|
||||
{
|
||||
teamplayersallies = countplayers( "allies");
|
||||
teamplayersaxis = countplayers( "axis");
|
||||
if ( teamplayersallies > teamplayersaxis && !level.isresetting_grief )
|
||||
{
|
||||
self.team = "axis";
|
||||
self.sessionteam = "axis";
|
||||
self.pers[ "team" ] = "axis";
|
||||
self._encounters_team = "A";
|
||||
}
|
||||
else
|
||||
{
|
||||
self.team = "allies";
|
||||
self.sessionteam = "allies";
|
||||
self.pers[ "team" ] = "allies";
|
||||
self._encounters_team = "B";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user