Polyzone Creator
A script tool that facilitates easier creation of zones using the zone scripts.
Dependencies : polyzone or ox_lib
starter
cd web
yarn > yarn build
yarn build:dev for development
Alternatively, you can directly add the Releases folder to your server.
! “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.”
examples
example Polyzone
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)
example lib.zone
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)