I ve tried your script and the game kick me to start menu ."cannot parse script file" thats the error
so i made a small change in with this part of script :
Code: Select all
thread check_allies_bomb
thread check_axis_bomb
thread prevent_player_spawn
check_allies_bomb:
while(1)
{
if (local.bomb1.exploded == 1)
{
while(1)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if ((isAlive $player[local.i]) && $player[local.i].dmteam=="allies")
{
}
if($player[local.i].dead == 0)
{
$player[local.i].dead = 1
}
}
}
waitframe
}
end
}
end
check_axis_bomb:
while(1)
{
if (local.bomb1.exploded == 1)
{
while(1)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if ((isAlive $player[local.i]) && $player[local.i].dmteam=="axis")
{
}
if($player[local.i].dead == 0)
{
$player[local.i].dead = 1
}
}
}
waitframe
}
end
}
end
prevent_player_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
However with the script above something is wrong and console say this error in LOOP each 1 ms:
Code: Select all
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
^~^~^ Script Error: Cannot cast 'NIL' to int
if($player[local.i].dead == 1) (maps/obj/mp_stargate_objective_final_obj.scr, 285)
if($player^
where is the error in the script above and below:
Code: Select all
count_players:
while(1)
{
level.allies = 0
level.axis = 0
for(local.i=1;local.i<=$player.size;local.i++)
{
if(isAlive $player[local.i])
{
if($player[local.i].dmteam=="allies")
{
level.allies++
}
else if($player[local.i].dmteam=="axis")
{
if($player[local.i].dead != 1)
{
level.axis++
}
}
}
}
if (level.axis == 0)
{
teamwin allies
}
else
if (level.allies == 0)
{
teamwin axis
}
}
end
Thx for the help
