Last active
December 31, 2022 10:10
-
-
Save tony0x59/cb32df6a91477f5f19e0253af16287f5 to your computer and use it in GitHub Desktop.
No More Zone Checks mod add Agrotsar support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doAgroMapZones() | |
--do nothing, remove this | |
end | |
function doAgrotsarMapZones() | |
-- print("doAgroMapZones") | |
local file = 'media/mapszones/Muldraugh, KY/agrozones.lua' | |
if fileExists(file) then | |
-- print("doAgroMapZones fileExists") | |
agrozones = {} | |
reloadLuaFile(file) | |
for k,v in ipairs(agrozones) do | |
if v.type == "Mannequin" then | |
handleMannequinZone(file, v) | |
elseif v.type == "SpawnOrigin" then | |
handleSpawnOrigin(file, v) | |
elseif v.type == "WaterFlow" then | |
handleWaterFlow(file, v) | |
elseif v.type == "WaterZone" then | |
handleWaterZone(file, v) | |
elseif v.geometry ~= nil then | |
if tonumber(v.lineWidth) then | |
v.properties = v.properties or {} | |
v.properties.LineWidth = v.lineWidth | |
end | |
getWorld():getMetaGrid():registerGeometryZone(v.name, v.type, v.z, v.geometry, v.points, v.properties) | |
else | |
local vzone = getWorld():registerVehiclesZone(v.name, v.type, v.x, v.y, v.z, v.width, v.height, v.properties) | |
-- print("doAgroMapZones vzone") | |
-- print(vzone) | |
if vzone == nil then | |
getWorld():registerZone(v.name, v.type, v.x, v.y, v.z, v.width, v.height) | |
end | |
end | |
table.wipe(v) | |
end | |
table.wipe(agrozones) | |
else | |
print('can\'t find map agrozones file: '..file) | |
end | |
getWorld():checkVehiclesZones(); | |
end | |
Events.OnLoadMapZones.Remove(doAgroMapZones); | |
Events.OnLoadMapZones.Add(doAgrotsarMapZones); |
Correct me if I'm wrong but I believe it should be:
function doAgroMapZones()
--do nothing, remove this
end
function doAgrotsarMapZones()
-- print("doAgroMapZones")
local file = 'media/mapszones/Muldraugh, KY/agrozones.lua'
if fileExists(file) then
-- print("doAgroMapZones fileExists")
agrozones = {}
reloadLuaFile(file)
for k,v in ipairs(agrozones) do
if v.type == "Mannequin" then
handleMannequinZone(file, v)
elseif v.type == "SpawnOrigin" then
handleSpawnOrigin(file, v)
elseif v.type == "WaterFlow" then
handleWaterFlow(file, v)
elseif v.type == "WaterZone" then
handleWaterZone(file, v)
elseif v.geometry ~= nil then
if tonumber(v.lineWidth) then
v.properties = v.properties or {}
v.properties.LineWidth = v.lineWidth
end
getWorld():getMetaGrid():registerGeometryZone(v.name, v.type, v.z, v.geometry, v.points, v.properties)
else
local vzone = getWorld():registerVehiclesZone(v.name, v.type, v.x, v.y, v.z, v.width, v.height, v.properties)
-- print("doAgroMapZones vzone")
-- print(vzone)
if vzone == nil then
getWorld():registerZone(v.name, v.type, v.x, v.y, v.z, v.width, v.height)
end
end
table.wipe(v)
end
table.wipe(agrozones)
else
print('can\'t find map agrozones file: '..file)
end
getWorld():checkVehiclesZones();
end
Events.OnLoadMapZones.Remove(doAgroMapZones);
Events.OnLoadMapZones.Add(doAgrotsarMapZones);
Correct me if I'm wrong but I believe it should be:
function doAgroMapZones() --do nothing, remove this end function doAgrotsarMapZones() -- print("doAgroMapZones") local file = 'media/mapszones/Muldraugh, KY/agrozones.lua' if fileExists(file) then -- print("doAgroMapZones fileExists") agrozones = {} reloadLuaFile(file) for k,v in ipairs(agrozones) do if v.type == "Mannequin" then handleMannequinZone(file, v) elseif v.type == "SpawnOrigin" then handleSpawnOrigin(file, v) elseif v.type == "WaterFlow" then handleWaterFlow(file, v) elseif v.type == "WaterZone" then handleWaterZone(file, v) elseif v.geometry ~= nil then if tonumber(v.lineWidth) then v.properties = v.properties or {} v.properties.LineWidth = v.lineWidth end getWorld():getMetaGrid():registerGeometryZone(v.name, v.type, v.z, v.geometry, v.points, v.properties) else local vzone = getWorld():registerVehiclesZone(v.name, v.type, v.x, v.y, v.z, v.width, v.height, v.properties) -- print("doAgroMapZones vzone") -- print(vzone) if vzone == nil then getWorld():registerZone(v.name, v.type, v.x, v.y, v.z, v.width, v.height) end end table.wipe(v) end table.wipe(agrozones) else print('can\'t find map agrozones file: '..file) end getWorld():checkVehiclesZones(); end Events.OnLoadMapZones.Remove(doAgroMapZones); Events.OnLoadMapZones.Add(doAgrotsarMapZones);
yes, you are right, thank you fix it!
code updated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
origin mod link, subscribe it:
https://steamcommunity.com/sharedfiles/filedetails/?id=2847449198
add this file to workshop mod path: E:\SteamLibrary\steamapps\workshop\content\108600\2847449198\mods\NoMoreZoneChecks\media\lua\server\metazones\AGROZones.lua
mod load order:
...
Tsarzones(Tsar's Common Library),
Aquazones(Aquatsar Yacht Club),
Agrozones(Argotsar Farming Company),
No More Zone Checks,
...