Code:
spawnpeople()
{
while(1)
{
self waittill( "joined_team" );
if(level.spawn != 0 && self.firstspawn != 1)
{
wait 0.1;
self.randomspawn = RandomInt(level.spawnlocation.size) + 1;
self SetOrigin(level.spawnlocation[self.randomspawn]);
self.firstspawn = 0;
}
else
{
if(self.team == "allies" && level.alliesspawn == 1 && level.beginspawn == 1)
{
wait 0.1;
self.alliesrandomspawn = RandomInt(level.alliesspawnlocation.size) + 1;
self SetOrigin(level.alliesspawnlocation[self.alliesrandomspawn]);
}
elseif(self.team == "axis" && level.axisspawn == 1 && level.beginspawn == 1)
{
wait 0.1;
self.axisrandomspawn = RandomInt(level.axisspawnlocation.size) + 1;
self SetOrigin(level.axisspawnlocation[self.axisrandomspawn]);
}
}
}
}
Shouldn't it be
Code:
else
{
if(self.team == "axis" && level.axisspawn == 1 && level.beginspawn == 1)
{
wait 0.1;
self.axisrandomspawn = RandomInt(level.axisspawnlocation.size) + 1;
self SetOrigin(level.axisspawnlocation[self.axisrandomspawn]);
}