agentmad007 wrote:However just a question , i understood that the script check if the bomb explode .Once it is done , the script check how many axis is alive , but i dont see any teamwin if there is no more axis .
one more thing i'd like the script to check allies and axis , but no worries i think i can change it......and actually the bomb run with another objective so i dont want to make them win only if they explode the bomb.
If i can grab more details plz

Where it has the iprintln statements, you can replace those with
Code: Select all
if (level.axis == 0)
{
teamwin allies
}
If you want the allies to win after a certain amount of bombs exploded, set a new variable, such as level.objectives. Make multiple if statements to figure out if the bomb has exploded then add 1 to the variable. Once the variable is equal to a certain number, then do the script to check how many axis players are alive.
Lets do a little example.
If there are 3 bombs in your map that you want to explode before the axis spawn is disabled, then you could do something like this:
Code: Select all
level.objectives = 0
thread check_obj
thread check_players
thread prevent_axis_spawn
end
check_obj:
while(1)
{
if(local.bomb1.exploded == 1)
{
level.objectives = level.objectives + 1
}
if(local.bomb2.exploded == 1)
{
level.objectives = level.objectives + 1
}
if(local.bomb3.exploded == 1)
{
level.objectives = level.objectives + 1
}
}
end
check_players:
while(1)
{
if(level.objectives == 3)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if (isAlive $player[local.i])
{
//do nothing
}
else
{
if($player[local.i].dmteam=="allies")
{
//do nothing
}
else if($player[local.i].dmteam=="axis")
{
if($player[local.i].dead == 0)
{
$player[local.i].dead = 1
}
}
}
}
}
}
end
prevent_axis_spawn:
while(1)
{
if($player[local.i].dead == 1)
{
$player[local.i] takeall
$player[local.i] hide
$player[local.i] notsolid
$player[local.i] noclip
}
wait .1
}
end
}
end
In this example, it doesn't check the players until AFTER the three bombs have exploded. Once they explode, it triggers the script to check if any axis players die. If so, the next time they spawn, they will "unspawn." Hope this helps.