File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
- local jobs , gangs
2
-
3
- local function refreshCache ()
4
- local groups = lib .callback .await (' qbx_core:server:getGroups' )
5
- jobs = groups .jobs
6
- gangs = groups .gangs
7
- end
1
+ local jobs = require ' shared.jobs'
2
+ local gangs = require ' shared.gangs'
8
3
9
4
--- @return table<string , Job>
10
5
function GetJobs ()
11
- if not jobs then refreshCache () end
12
6
return jobs
13
7
end
14
8
15
9
exports (' GetJobs' , GetJobs )
16
10
17
11
--- @return table<string , Gang>
18
12
function GetGangs ()
19
- if not gangs then refreshCache () end
20
13
return gangs
21
14
end
22
15
@@ -25,7 +18,6 @@ exports('GetGangs', GetGangs)
25
18
--- @param name string
26
19
--- @return Job ?
27
20
function GetJob (name )
28
- if not jobs then refreshCache () end
29
21
return jobs [name ]
30
22
end
31
23
@@ -34,7 +26,6 @@ exports('GetJob', GetJob)
34
26
--- @param name string
35
27
--- @return Gang ?
36
28
function GetGang (name )
37
- if not gangs then refreshCache () end
38
29
return gangs [name ]
39
30
end
40
31
47
38
RegisterNetEvent (' qbx_core:client:onGangUpdate' , function (gangName , gang )
48
39
gangs [gangName ] = gang
49
40
end )
41
+
42
+ local groups = lib .callback .await (' qbx_core:server:getGroups' )
43
+ jobs = groups .jobs
44
+ gangs = groups .gangs
You can’t perform that action at this time.
0 commit comments