mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
refactor(client/zoneCreator): restrict command access
Includes fix for zone name.
This commit is contained in:
@@ -68,7 +68,7 @@ RegisterCommand('zone', function(source, args, rawCommand)
|
|||||||
startCreator(args[1])
|
startCreator(args[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end, true)
|
||||||
|
|
||||||
local function closeCreator(cancel)
|
local function closeCreator(cancel)
|
||||||
if not cancel then
|
if not cancel then
|
||||||
@@ -76,7 +76,7 @@ local function closeCreator(cancel)
|
|||||||
points[#points + 1] = vec(xCoord, yCoord)
|
points[#points + 1] = vec(xCoord, yCoord)
|
||||||
end
|
end
|
||||||
|
|
||||||
lib.inputDialog(('Name your %s Zone'):format(firstToUpper(zoneType)), {'Name'})
|
local name = lib.inputDialog(('Name your %s Zone'):format(firstToUpper(zoneType)), {'Name'})
|
||||||
|
|
||||||
TriggerServerEvent('ox_lib:saveZone', {
|
TriggerServerEvent('ox_lib:saveZone', {
|
||||||
zoneType = zoneType,
|
zoneType = zoneType,
|
||||||
@@ -94,7 +94,7 @@ local function closeCreator(cancel)
|
|||||||
|
|
||||||
creatorActive = false
|
creatorActive = false
|
||||||
controlsActive = false
|
controlsActive = false
|
||||||
lib.hideTextUI(true)
|
lib.hideTextUI()
|
||||||
zoneType = nil
|
zoneType = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ CreateThread(function()
|
|||||||
elseif IsDisabledControlJustPressed(0, 22) then -- space
|
elseif IsDisabledControlJustPressed(0, 22) then -- space
|
||||||
change = true
|
change = true
|
||||||
if zoneType == 'poly' then
|
if zoneType == 'poly' then
|
||||||
points[#points + 1] = vec(xCoord, yCoord)
|
points[#points + 1] = vec2(xCoord, yCoord)
|
||||||
end
|
end
|
||||||
|
|
||||||
local coords = GetEntityCoords(cache.ped)
|
local coords = GetEntityCoords(cache.ped)
|
||||||
Reference in New Issue
Block a user