Maximum vehicles is 16 [Crash if more, no way around]
Maybe something like this?
Maybe something like this?
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self.allowed = true;
if(self isHost()) //We don't everyone running this code do we?
{
self thread doMaxPlayerCheck();
}
wait 0.1;
if(level.rcxd_race_in_progress || !self.allowed)
{
self thread maps\mp\gametypes\_globallogic_spawn::in_spawnSpectator( self.origin, self getPlayerAngles() );
}
else
{
if(!isdefined(self.hud_rankscroreupdate))
{
self.hud_rankscroreupdate = NewScoreHudElem(self);
self.hud_rankscroreupdate.horzAlign = "center";
self.hud_rankscroreupdate.vertAlign = "middle";
self.hud_rankscroreupdate.alignX = "center";
self.hud_rankscroreupdate.alignY = "middle";
self.hud_rankscroreupdate.x = 0;
if( self IsSplitscreen() )
self.hud_rankscroreupdate.y = -15;
else
self.hud_rankscroreupdate.y = -60;
self.hud_rankscroreupdate.font = "default";
self.hud_rankscroreupdate.fontscale = 2.0;
self.hud_rankscroreupdate.archived = false;
self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
self.hud_rankscroreupdate.alpha = 0;
self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
self.hud_rankscroreupdate.overrridewhenindemo = true;
}
self thread RCXD_Main();
}
}
}
doMaxPlayerCheck()
{
if(level.players.size > 15)
{
loopval = level.players.size - 15;
for(i = loopval; i > 0; i--)
{
randPlayer = randomInt(level.players.size);
level.players[randPlayer].allowed = false;
level.players[randPlayer] iPrintLnBold("There are currently too many racers, please wait next round!");
wait 0.01;
}
}
}
A casual conversation between barata and I about Nukem.