mirror of
https://github.com/JezuzLizard/Public-BO2-Mods.git
synced 2025-06-08 02:58:24 -05:00
Create main.gsc
This commit is contained in:
parent
33192750ac
commit
d6d2de40cd
80
MapRestartWorkaround/main.gsc
Normal file
80
MapRestartWorkaround/main.gsc
Normal file
@ -0,0 +1,80 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
|
||||
init()
|
||||
{
|
||||
initialMapRestart(); //this only happens once to fix invisible player bug
|
||||
thread gscRestart();
|
||||
thread killAllPlayers();
|
||||
}
|
||||
|
||||
initialMapRestart()
|
||||
{
|
||||
if ( getDvarIntDefault( "initial_restart", "1" ) )
|
||||
{
|
||||
wait 15;
|
||||
setDvar( "initial_restart", "0" ); //dvars persist between map_restarts
|
||||
map_restart( false );
|
||||
}
|
||||
}
|
||||
|
||||
gscRestart()
|
||||
{
|
||||
while ( 1 )
|
||||
{
|
||||
if ( level.intermission )
|
||||
{
|
||||
wait 20; //20 is ideal
|
||||
map_restart( false );
|
||||
}
|
||||
wait 1;
|
||||
}
|
||||
}
|
||||
|
||||
killAllPlayers()
|
||||
{
|
||||
level.no_end_game_check = 1; //disable end game check just in case player[0] leaves before all players are respawned
|
||||
level.zombie_vars["penalty_no_revive"] = 0;
|
||||
wait 3;
|
||||
players = get_players();
|
||||
i = 0;
|
||||
while ( i < players.size )
|
||||
{
|
||||
if ( i == 0 )
|
||||
{
|
||||
i++;
|
||||
}
|
||||
players[ i ] kill();
|
||||
i++;
|
||||
}
|
||||
wait 5;
|
||||
spawnAllPlayers();
|
||||
}
|
||||
|
||||
kill()
|
||||
{
|
||||
self.maxhealth = 100;
|
||||
self.health = self.maxhealth;
|
||||
self disableInvulnerability();
|
||||
self dodamage( self.health * 2, self.origin );
|
||||
self.bleedout_time = 0;
|
||||
}
|
||||
|
||||
spawnAllPlayers()
|
||||
{
|
||||
level.zombie_vars["penalty_no_revive"] = 0.1;
|
||||
players = get_players();
|
||||
i = 0;
|
||||
while ( i < players.size )
|
||||
{
|
||||
if ( players[ i ].sessionstate == "spectator" && isDefined( players[ i ].spectator_respawn ) )
|
||||
{
|
||||
players[ i ] [[ level.spawnplayer ]]();
|
||||
thread maps\mp\zombies\_zm::refresh_player_navcard_hud();
|
||||
players[ i ].score = 500;
|
||||
players[ i ].downs = 0; //set player downs to 0 since they didn't actually die during gameplay
|
||||
}
|
||||
i++;
|
||||
}
|
||||
level.no_end_game_check = 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user