-
Notifications
You must be signed in to change notification settings - Fork 8
/
client.lua
69 lines (60 loc) · 1.65 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
59
60
61
62
63
64
65
66
67
68
69
local showCheck = false
local showBrand = false
RegisterNUICallback('showBrand', function()
Wait(50)
TriggerEvent("lj-brand:client:Logo")
end)
local function updateBrand(data)
SendNUIMessage({
action = 'brand',
showBrand = data[1],
})
end
RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()
if Config.showBrand == true then
showBrand = true
updateBrand({
showBrand,
})
end
end)
RegisterNetEvent("lj-brand:client:Logo", function()
showBrand = not showBrand
TriggerEvent("hud:client:checklistSounds")
if showBrand == true then
showBrand = true
updateBrand({
showBrand,
})
elseif showBrand == false then
updateBrand({
showBrand,
})
showBrand = false
end
TriggerEvent("hud:client:checklistSounds")
end)
AddEventHandler('lj-brand:client:open', function()
SetNuiFocus(true, true)
SendNUIMessage({ action = "open"})
showCheck = true
if Config.Sound == true then
TriggerServerEvent("InteractSound_SV:PlayOnSource", "StashOpen", 0.5)
end
end)
RegisterCommand('checklist', function()
if not showCheck then
SetNuiFocus(true, true)
SendNUIMessage({ action = "open"})
showCheck = true
if Config.Sound == true then
TriggerServerEvent("InteractSound_SV:PlayOnSource", "StashOpen", 0.5)
end
end
end)
RegisterNUICallback('closeCheckList', function()
showCheck = false
SetNuiFocus(false, false)
TriggerEvent('QBCore:Notify', "Welcome to the server!", "success")
end)
RegisterKeyMapping('checklist', 'Open Checklist', 'keyboard', Config.OpenKey)