1038 -- other event handlers |
1038 -- other event handlers |
1039 -------------------------- |
1039 -------------------------- |
1040 |
1040 |
1041 function onParameters() |
1041 function onParameters() |
1042 parseParams() |
1042 parseParams() |
1043 if params["rounds"] ~= nil then |
1043 if params["rounds"] ~= nil and tonumber(params["rounds"]) then |
1044 SI.roundLimit = math.floor(tonumber(params["rounds"])) |
1044 SI.roundLimit = math.floor(tonumber(params["rounds"])) |
1045 end |
1045 end |
1046 if params["barrels"] ~= nil then |
1046 if params["barrels"] ~= nil and tonumber(params["barrels"]) then |
1047 SI.startBarrels = math.floor(tonumber(params["barrels"])) |
1047 SI.startBarrels = math.floor(tonumber(params["barrels"])) |
1048 end |
1048 end |
1049 if params["pings"] ~= nil then |
1049 if params["pings"] ~= nil and tonumber(params["pings"]) then |
1050 SI.startRadShots = math.floor(tonumber(params["pings"])) |
1050 SI.startRadShots = math.floor(tonumber(params["pings"])) |
1051 end |
1051 end |
1052 if params["shield"] ~= nil then |
1052 if params["shield"] ~= nil and tonumber(params["shield"]) then |
1053 SI.startShield = math.min(250-80, math.floor(tonumber(params["shield"]))) |
1053 SI.startShield = math.min(250-80, math.floor(tonumber(params["shield"]))) |
1054 end |
1054 end |
1055 |
1055 |
1056 if params["barrelbonus"] ~= nil then |
1056 if params["barrelbonus"] ~= nil and tonumber(params["barrelbonus"]) then |
1057 SI.barrelBonus = math.floor(tonumber(params["barrelbonus"])) |
1057 SI.barrelBonus = math.floor(tonumber(params["barrelbonus"])) |
1058 end |
1058 end |
1059 if params["shieldbonus"] ~= nil then |
1059 if params["shieldbonus"] ~= nil and tonumber(params["shieldbonus"]) then |
1060 SI.shieldBonus = math.floor(tonumber(params["shieldbonus"])) |
1060 SI.shieldBonus = math.floor(tonumber(params["shieldbonus"])) |
1061 end |
1061 end |
1062 if params["timebonus"] ~= nil then |
1062 if params["timebonus"] ~= nil and tonumber(params["timebonus"]) then |
1063 SI.timeBonus = math.floor(tonumber(params["timebonus"])) |
1063 SI.timeBonus = math.floor(tonumber(params["timebonus"])) |
1064 end |
1064 end |
1065 if params["forcetheme"] == "false" then |
1065 if params["forcetheme"] == "false" then |
1066 SI.forceTheme = false |
1066 SI.forceTheme = false |
1067 else |
1067 else |