#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
Init()
{
kills_limit = 60;
time_limit = 10;
if (level.players.size <= 6)
{
kills_limit = 80;
time_limit = 10;
}
else if (level.players.size > 6 && level.players.size <= 12)
{
kills_limit = 125;
time_limit = 15;
}
else if (level.players.size > 13)
{
kills_limit = 175;
time_limit = 20;
}
SetLimits(kills_limit,time_limit);
}
SetLimits(kills_limit, time_limit)
{
score_multiplier = 0;
SetDvar("scr_" + level.gameType + "_scorelimit", kills_limit * score_multiplier);
SetDvar("scorelimit", kills_limit * score_multiplier);
if (time_limit != undefined)
{
SetDvar("scr_" + level.gameType + "_timelimit", time_limit);
SetDvar("timelimit", time_limit);
}
}
Gives me an error:
******* script runtime error *******
pair '10' and 'undefined' has unmatching types 'integer' and 'undefined'
at function "setlimits" in file "scripts/kills_limit.gsc"
at function "init" in file "scripts/kills_limit.gsc"
******* script runtime error *******
cannot cast undefined to bool in a control statement
at function "setlimits" in file "scripts/kills_limit.gsc"
at function "init" in file "scripts/kills_limit.gsc"
Sorry. Im not too good at GSC scripting. PHP and Python, much better. I can follow along with alot of this, but this error did not make sense.