problem
Posted: Thu Jun 23, 2005 10:35 pm
ok , why is it that this does not work???
It crashes the script
when this does work -
Code: Select all
peepscounter:
iprintln ("CT")
level.allies = 0
level.axis = 0
level.spectator = 0
for(local.dude=1;local.dude <= $player.size;local.dude++)
{
if ($player[local.dude].dmteam == "axis")
level.axis++
if ($player[local.dude].dmteam == "allies")
level.allies++
if ($player[local.dude].dmteam == "spectator")
level.spectator++
}
if (level.allies + level.axis + level.spectator <= 1)
{
local.totalpeeps = 1
}
if (level.allies + level.axis + level.spectator = 2)
{
local.totalpeeps = 2
}
if (level.allies + level.axis + level.spectator >= 3)
{
local.totalpeeps = 3
}
wait 1
setcvar totalpeeps local.totalpeeps
endwhen this does work -
Code: Select all
countpeeps:
iprintln ("counting")
level.allies = 0
level.axis = 0
level.spectator = 0
for(local.dude=1;local.dude <= $player.size;local.dude++)
{
if ($player[local.dude].dmteam == "axis")
level.axis++
if ($player[local.dude].dmteam == "allies")
level.allies++
if ($player[local.dude].dmteam == "spectator")
level.spectator++
}
if (level.allies + level.axis + level.spectator <= 6)
{
local.totalpeeps = 1
}
if ((level.allies + level.axis + level.spectator > 6) && (level.allies + level.axis + level.spectator < 15))
{
local.totalpeeps = 2
}
if (level.allies + level.axis + level.spectator >= 15)
{
local.totalpeeps = 3
}
wait 1
setcvar totalpeeps local.totalpeeps
end