一种脚本工具,可帮助您更轻松地使用区域脚本创建区域。
依赖项:polyzone 或 ox_lib
启动
cd web
yarn > yarn build
yarn build:dev for development
或者,您可以直接将 Releases 文件夹添加到您的服务器。
注意
“该脚本支持 2 个不同的区域脚本。在 Config.lua 中指定要使用的区域脚本后,在 fxmanifest.lua 中导入与要使用的区域脚本相关的文件,并删除或注释掉与其他脚本相关的导入。”例子
示例 Polyzone
lua:
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)
示例 lib.zone
lua:
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)