-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.lua
58 lines (54 loc) · 1.21 KB
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- Start with Penal Code not showing
local display = false
function SetDisplay(bool)
display = bool
SetNuiFocus(bool, bool)
SendNUIMessage(
{
type = "ui",
status = bool
}
)
end
-- Debug with "Penal" command
--[[ RegisterCommand('Penal', function(_, args)
if tostring(args[1]) == 'open' then
SetDisplay(true)
elseif tostring(args[1]) == 'close' then
SetDisplay(false)
else
print('Command not found!')
return
end
end) ]]
RegisterNUICallback(
"close",
function()
SetNuiFocus(false, false)
display = false
end
)
-- Set ox_target BoxZone
exports.ox_target:addBoxZone(
{
coords = vec3(-547.4033, -207.3018, 38.1638), -- CHANGE TO PROPER COORDS
size = vec3(1, 1, 1),
rotation = 45,
debug = false,
options = {
{
name = "Penal Box",
event = "ox_target:zo_penal",
icon = "fa-solid fa-book",
label = "Read Penal Codes"
}
}
}
)
-- EventHandler for clicking inside of the BoxZone
AddEventHandler(
"ox_target:zo_penal",
function()
SetDisplay(true)
end
)