sets players status to spectator instead of killing

This commit is contained in:
JezuzLizard 2020-03-12 03:24:45 -07:00
parent 6ff991e6ee
commit 0b2fcc2234
2 changed files with 14 additions and 17 deletions

View File

@ -1,5 +1,6 @@
#include maps\mp\_utility; #include maps\mp\_utility;
#include common_scripts\utility; #include common_scripts\utility;
//these map specific includes are all required for give_team_characters(), and give_personality_characters to work
#include maps\mp\zm_alcatraz_grief_cellblock; #include maps\mp\zm_alcatraz_grief_cellblock;
#include maps\mp\zm_prison; #include maps\mp\zm_prison;
#include maps\mp\zm_highrise; #include maps\mp\zm_highrise;
@ -10,7 +11,7 @@
init() init()
{ {
thread gscRestart(); thread gscRestart();
thread killAllPlayers(); thread setPlayersToSpectator();
for(;;) for(;;)
{ {
level waittill("connected", player); level waittill("connected", player);
@ -21,7 +22,7 @@ init()
else else
{ {
player thread give_personality_characters(); player thread give_personality_characters();
} }
} }
} }
@ -33,10 +34,9 @@ gscRestart()
map_restart( false ); map_restart( false );
} }
killAllPlayers() setPlayersToSpectator()
{ {
level.no_end_game_check = 1; //disable end game check just in case player[0] leaves before all players are respawned level.no_end_game_check = 1;
level.zombie_vars["penalty_no_revive"] = 0;
wait 3; wait 3;
players = get_players(); players = get_players();
i = 0; i = 0;
@ -46,25 +46,24 @@ killAllPlayers()
{ {
i++; i++;
} }
players[ i ] kill(); players[ i ] setToSpectator();
i++; i++;
} }
wait 5; wait 5;
spawnAllPlayers(); spawnAllPlayers();
} }
kill() setToSpectator()
{ {
self.maxhealth = 100; self.sessionstate = "spectator";
self.health = self.maxhealth; if (isDefined(self.is_playing))
self disableInvulnerability(); {
self dodamage( self.health * 2, self.origin ); self.is_playing = false;
self.bleedout_time = 0; }
} }
spawnAllPlayers() spawnAllPlayers()
{ {
level.zombie_vars["penalty_no_revive"] = 0.1;
players = get_players(); players = get_players();
i = 0; i = 0;
while ( i < players.size ) while ( i < players.size )
@ -73,8 +72,6 @@ spawnAllPlayers()
{ {
players[ i ] [[ level.spawnplayer ]](); players[ i ] [[ level.spawnplayer ]]();
thread maps\mp\zombies\_zm::refresh_player_navcard_hud(); 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++; i++;
} }

View File

@ -65,10 +65,10 @@ Not exactly ideal, but it does mean all players can remain in the lobby and all
#### Extras #### Extras
-Players keep all points -Players keep all points
-End game check is disabled just incase player[0] leaves during the respawn function its reenabled when players are respawned -End game check is disabled just in case player[0] leaves during the respawn function its reenabled when players are respawned
-Fixed invisible player glitch hopefully for good -Fixed invisible player glitch hopefully for good
-Players who were killed during the blackscreen have their downs set to 0 -Players are now directly set into spectator status instead being killed