Well:
Code: Select all
^~^~^ Script Error: Cannot cast 'NIL' to int
if(($player[local.i].starting_team != $player[local.i].dmteam) && ($player[local.i].jailed == 1)) (maps/obj/mp_stargate_anubis_apogee_obj.scr, 1002)
if(($player[local.i].starting_team != $player^
...is saying that it can not use NIL as an integer value.
The "^" indicates the index in the array. And indeed, local.i is not defined and thus is NIL.
Your error is in how "check_team_change" is defined and called.
You are trying to give the thread a parameter here:
Code: Select all
thread check_team_change $player[local.i]
...and this is a good idea, but your "check_team_change" needs to be prepared to recieve a parameter, like this:
So try this instead:
Code: Select all
alliesIsTouching:
for (local.i = 1; local.i <= $player.size; local.i++)
{
if ($player[local.i].dmteam == "allies")
{
$player[local.i].starting_team = $player[local.i].dmteam
if($player[local.i] istouching $alliesjailboxin)
{
level.allies_dead++
$player[local.i].jailed = 1
$player[local.i].outofweapon = 1
$player[local.i] thread SetImmunities
$player[local.i] takeall
thread check_team_change $player[local.i]
}
}
}
end
check_team_change local.da_playa:
if((local.da_playa.starting_team != local.da_playa.dmteam) && (local.da_playa.jailed == 1))
{
local.da_playa iprint "you ve changed team" 0
}
end