mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
feat(resource/zoneCreator): target output format
This commit is contained in:
@@ -54,6 +54,7 @@ local function closeCreator(cancel)
|
|||||||
{ type = 'select', label = 'Format', default = format, options = {
|
{ type = 'select', label = 'Format', default = format, options = {
|
||||||
{ value = 'function', label = 'Function' },
|
{ value = 'function', label = 'Function' },
|
||||||
{ value = 'array', label = 'Array' },
|
{ value = 'array', label = 'Array' },
|
||||||
|
{ value = 'target', label = 'Target'},
|
||||||
}}
|
}}
|
||||||
}) or {}
|
}) or {}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,18 @@ local poly = lib.zones.poly({
|
|||||||
},
|
},
|
||||||
thickness = 2,
|
thickness = 2,
|
||||||
},
|
},
|
||||||
|
-- target
|
||||||
|
exports.ox_target:addPolyZone({
|
||||||
|
name = poly,
|
||||||
|
points = {
|
||||||
|
vec(447.9, -998.8, 25.8),
|
||||||
|
vec(450.3, -998.2, 25.8),
|
||||||
|
vec(449.9, -995.5, 25.8),
|
||||||
|
vec(447.2, -995.6, 25.8),
|
||||||
|
vec(446.3, -997.9, 25.8),
|
||||||
|
},
|
||||||
|
thickness = 2,
|
||||||
|
})
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local parse = {
|
local parse = {
|
||||||
@@ -51,6 +63,15 @@ local parse = {
|
|||||||
('\tthickness = %s,\n'):format(data.height),
|
('\tthickness = %s,\n'):format(data.height),
|
||||||
'},\n'
|
'},\n'
|
||||||
}
|
}
|
||||||
|
elseif data.format == 'target' then
|
||||||
|
pattern = {
|
||||||
|
'exports.ox_target:addPolyZone({\n',
|
||||||
|
('\tname = "%s",\n'):format(data.name),
|
||||||
|
'\tpoints = {\n',
|
||||||
|
('%s\t},\n'):format(table.concat(points)),
|
||||||
|
('\tthickness = %s,\n'):format(data.height),
|
||||||
|
'})\n'
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
return table.concat(pattern)
|
return table.concat(pattern)
|
||||||
@@ -75,6 +96,15 @@ local parse = {
|
|||||||
('\trotation = %s,\n'):format(data.heading),
|
('\trotation = %s,\n'):format(data.heading),
|
||||||
'},\n',
|
'},\n',
|
||||||
}
|
}
|
||||||
|
elseif data.format == 'target' then
|
||||||
|
pattern = {
|
||||||
|
'exports.ox_target:addBoxZone({\n',
|
||||||
|
('\tname = "%s",\n'):format(data.name),
|
||||||
|
('\tcoords = vec3(%s, %s, %s),\n'):format(data.xCoord, data.yCoord, data.zCoord),
|
||||||
|
('\tsize = vec3(%s, %s, %s),\n'):format(data.width, data.length, data.height),
|
||||||
|
('\trotation = %s,\n'):format(data.heading),
|
||||||
|
'})\n',
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
return table.concat(pattern)
|
return table.concat(pattern)
|
||||||
@@ -97,6 +127,14 @@ local parse = {
|
|||||||
('\tradius = %s,\n'):format(data.height),
|
('\tradius = %s,\n'):format(data.height),
|
||||||
'},\n',
|
'},\n',
|
||||||
}
|
}
|
||||||
|
elseif data.format == 'target' then
|
||||||
|
pattern = {
|
||||||
|
'exports.ox_target:addSphereZone({\n',
|
||||||
|
('\tname = "%s",\n'):format(data.name),
|
||||||
|
('\tcoords = vec3(%s, %s, %s),\n'):format(data.xCoord, data.yCoord, data.zCoord),
|
||||||
|
('\tradius = %s,\n'):format(data.height),
|
||||||
|
'})\n',
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
return table.concat(pattern)
|
return table.concat(pattern)
|
||||||
|
|||||||
Reference in New Issue
Block a user