1+ function AddNetworkPropTarget (entity , options )
2+ exports .ox_target :addEntity (entity , options )
3+ end
4+
5+ function RandomMiniGame ()
6+ local minigames = {' qte' , ' circle' , ' memory' , ' math' , ' reaction' }
7+ return minigames [math.random (1 , # minigames )]
8+ end
9+
10+ function ProgressBar (label , duration , options )
11+ options = options or {}
12+ return lib .progressBar ({
13+ duration = duration or 3000 ,
14+ label = label or ' Working...' ,
15+ useWhileDead = options .useWhileDead or false ,
16+ canCancel = options .canCancel ~= false ,
17+ disable = options .disable or {
18+ move = true ,
19+ car = true ,
20+ combat = true
21+ },
22+ anim = options .anim ,
23+ prop = options .prop
24+ })
25+ end
26+
27+ function Notif (src , msg )
28+ TriggerEvent (' ox_lib:notify' , {
29+ type = ' success' ,
30+ title = ' Construction Robbery' ,
31+ description = msg ,
32+ duration = 5000 ,
33+ position = ' top-right'
34+ })
35+ end
36+
37+ function RunMiniGame (game )
38+ local games = Config .MiniGames
39+ if not game or game == ' random' then
40+ local keys = {}
41+ for k in pairs (games ) do
42+ keys [# keys + 1 ] = k
43+ end
44+ game = keys [math.random (# keys )]
45+ end
46+ local fn = games [game ]
47+ return fn and fn () or false
48+ end
0 commit comments