doEmission(); is executed somewhere on the code. level.emissionincoming = false; is put under init();
When the large earthquake and the sound are due to start, everyone times out except for me. This is a dedicated server.
Please only post the part of this code which needs to be fixed, and not the entire code.
thanks
Code:
doEmission()
{
level endon("emission_cancel");
level endon("emission_end");
if(level.emissionincoming) return 0;
level.emissionIncoming = true;
level thread emissionEarthquake();
currentEmissionClock = 0;
emissionTimer = spawn("script_origin", (0,0,0));
emissionTimer hide();
while(currentEmissionClock != 10)
{
currentEmissionClock += 1;
emissionTimer playSound("ui_mp_nukebomb_timer");
if(currentEmissionClock <= 5) wait(5);
else wait(1);
}
level.emissionIncoming = false;
level.emissionInProgress = true;
earthquake(0.25, 12, (0, -2500, 0), 100000);
emissionTimer playSound("nuke_wave");
//setDvar("r_todoverride","2 1.3 0.8");
wait 2;
foreach(player in level.players)
{
player thread radiationEffect();
}
wait 6;
level.emissionInProgress = false;
wait 2;
level notify("radiation_stop");
level notify("emission_end");
emissionTimer destroy();
}
emissionEarthquake()
{
level endon("emission_cancel");
level endon("emission_end");
while(level.emissionIncoming)
{
wait randomint(10);
duration = (randomint(9) + 1);
intensity = (randomint(5)/20);
emissionEnt = getEntArray("mp_global_intermission", "classname");
earthquake(intensity, duration, emissionEnt[0].origin, 100000);
wait duration;
}
}
radiationEffect()
{
self.poison = 0;
while(1)
{
if(self.issafe) continue;
if(!isAlive(self)) continue;
if(!level.emissioninprogress) continue;
self.radiation ++;
if(self.radiation == 1) {
self ViewKick(1, self.origin);
} else if(self.radiation == 3) {
self shellshock("mp_radiation_low", 4);
self ViewKick(3, self.origin);
self doRadiationDamage(15);
} else if(self.radiation == 4) {
self shellshock("mp_radiation_med", 5);
self ViewKick(15, self.origin);
self doRadiationDamage(25);
} else if(self.radiation == 5) {
self shellshock("mp_radiation_high", 5);
self ViewKick(75, self.origin);
self doRadiationDamage(45);
} else if(self.radiation == 6) {
self shellshock("mp_radiation_high", 5);
self ViewKick(127, self.origin);
self doRadiationDamage(175);
}
wait(1);
}
wait(5);
}
doRadiationdamage(iDamage)
{
self thread [[ level.callbackPlayerDamage ]](self,self,iDamage,0,"MOD_SUICIDE","claymore_mp",self.origin,(0,0,0) - self.origin,"none",0);
}
When the large earthquake and the sound are due to start, everyone times out except for me. This is a dedicated server.
Please only post the part of this code which needs to be fixed, and not the entire code.
thanks