-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathclient.lua
51 lines (46 loc) · 1.36 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
-- Initialize Config
local Config = Config or {}
local hasPlayerLoaded = false
CreateThread(function()
Wait(10000)
hasPlayerLoaded = true
end)
-- Client event to handle gavel sounds
RegisterNetEvent('zogavel:play_gavel_sound', function(soundFile, soundVolume)
if hasPlayerLoaded then
SendNUIMessage({
transactionType = 'playSound',
transactionFile = soundFile,
transactionVolume = soundVolume
})
end
end)
-- Set ox_target BoxZone
exports.ox_target:addBoxZone({
coords = Config.gavelLocation,
size = vec3(1, 1, 1),
rotation = 45,
debug = false,
options = {
{
-- groups = "judge", -- ADD PROPER JOB NAME
name = "Gavel",
event = "zogavel:play_gavel_sound_server",
icon = "fa-solid fa-gavel",
label = "Gavel - one time",
soundType = "one"
},
{
-- groups = "judge", -- ADD PROPER JOB NAME
name = "Gavel",
event = "zogavel:play_gavel_sound_server",
icon = "fa-solid fa-gavel",
label = "Gavel - three times",
soundType = "three"
}
}
})
-- EventHandler for clicking inside of the BoxZone
AddEventHandler("zogavel:play_gavel_sound_server", function(targetData)
TriggerServerEvent('zogavel:play_gavel_sound', targetData.soundType)
end)