forked from qbcore-framework/qb-bankrobbery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cl_config.lua
67 lines (59 loc) · 2.53 KB
/
cl_config.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
Config = Config or {}
Config.UseTarget = true -- Use qb-target interactions (don't change this, go to your server.cfg and add `setr UseTarget true` to use this and just that from true to false or the other way around)
-- This is the handler for the cop count, you can change this to anything you want as this is by default the qb-policejob event
RegisterNetEvent('police:SetCopCount', function(amount)
CurrentCops = amount
end)
--- This function will be executed once a doorlock action is happening, so locking or unlocking a door
--- @param doorId number | string
--- @param setLocked boolean
--- @return nil
function Config.DoorlockAction(doorId, setLocked)
TriggerServerEvent('qb-doorlock:server:updateState', doorId, setLocked, false, false, true, false, false)
end
--- This will be triggered once an action happens that can drop evidence
--- @param pos vector3
--- @param chance number
--- @return nil
function Config.OnEvidence(pos, chance)
if math.random(1, 100) > chance or QBCore.Functions.IsWearingGloves() then return end
TriggerServerEvent("evidence:server:CreateFingerDrop", pos)
end
--- This will be called each 10 seconds whilst drilling a safety deposit box
--- @return nil
function Config.OnDrillingAction()
TriggerServerEvent('hud:server:GainStress', math.random(3, 6))
end
--- This is triggered whenever a robbery call is made by the alarm of a bank
--- @param message string
--- @return nil
function Config.OnPoliceAlert(message)
TriggerServerEvent("police:server:policeAlert", message)
end
--- This is called when the user is nearby an interaction that requires said items, this will trigger the box that shows what items you need
---
--- Format for `items`:
--- ```lua
--- {
--- [itemIndexNumber] = { name = 'itemName', image = 'itemImage' }
--- }
--- ```
--- @param items table | nil
--- @param show boolean
--- @return nil
function Config.ShowRequiredItems(items, show)
TriggerEvent('inventory:client:requiredItems', items, show)
end
function Config.GetMinimumPaletoPolice()
return GetConvarInt("vrcgta:bankrobbery:minimumPaletoPolice", 999)
end
function Config.GetMinimumPacificPolice()
return GetConvarInt("vrcgta:bankrobbery:minimumPacificPolice", 999)
end
function Config.GetMinimumFleecaPolice()
return GetConvarInt("vrcgta:bankrobbery:minimumFleecaPolice", 999)
end
function Config.GetMinimumThermitePolice()
return GetConvarInt("vrcgta:bankrobbery:minimumThermitePolice", 999)
end
Config.OutlawCooldown = 5 -- The amount of minutes it takes for the cops to be able to be called again after they were called