A script tool that facilitates easier creation of polyzones using the PolyZone script.
Dependencies : https://github.com/mkafrin/PolyZone or https://github.com/overextended/ox_lib
cd web
yarn > yarn build
yarn build:dev for development
"The script supports 2 different zone scripts. After specifying the zone script you want to use in Config.lua, import the file related to the zone script you want to use in fxmanifest.lua and remove or comment out the import related to the other script."
local PolyZoneMode = exports['polyZoneCreator']:PolyZoneMode();
RegisterCommand("startCreate", function()
local options = {
name = string, -- (optional) the name of the zone. If not provided, a form will be opened;
placeholder = string, -- (optional)
buttontext = string, -- (optional)
}
PolyZoneMode.start(function(data)
-- data = {
-- succes = boolean,
-- name = string,
-- points = vector3[],
-- minZ = double,
-- maxZ = double,
-- polyzone = polyzone,
-- error = string
-- }
poly = PolyZone:Create(data.points, {
name = data.name,
minZ = data.minZ,
maxZ = data.maxZ,
debugGrid = false,
debugPoly = false
})
end , options -- (optional) )
end)
local PolyZoneMode = exports['polyZoneCreator']:PolyZoneMode();
RegisterCommand("startCreate", function()
local options = {
name = string, -- (optional) the name of the zone. If not provided, a form will be opened;
placeholder = string, -- (optional)
buttontext = string, -- (optional)
}
PolyZoneMode.start(function(data)
-- data = {
-- succes = boolean,
-- name = string,
-- points = vector3[],
-- thickness = number,
-- minZ = double,
-- polyzone = polyzone,
-- error = string
-- }
poly = lib.zones.poly({
name = data.name,
points = data.points,
thickness = data.thickness,
debug = false,
inside = inside,
onEnter = onEnter,
onExit = onExit
})
end , options -- (optional) )
end)