4040---- ------------------------------------
4141-- open store with opening hours
4242---- ------------------------------------
43+ ---- - SCORPION UPDATE 26 March 2025
4344AddEventHandler (' qc-advanced-trapper:client:openstore' , function ()
44- local hour = GetClockHours ()
45- if (hour < Config .OpenTime ) or (hour >= Config .CloseTime ) then
46- if Config .Notify == ' rnotify' then
47- TriggerEvent (' rNotify:NotifyLeft' , " Store Closed" , " come back after " .. Config .OpenTime .. " am" , " generic_textures" , " tick" , 4000 )
48- elseif Config .Notify == ' ox_lib' then
49- lib .notify ( {title = " Store Closed" , description = " come back after " .. Config .OpenTime .. " am" , type = ' inform' })
50- end
51- return
52- end
5345 TriggerEvent (' qc-advanced-trapper:client:menu' )
5446end )
47+
5548-- get store hours function
5649local GetTrapperHours = function ()
50+ -- Check if AlwaysOpen is true
51+ if Config .AlwaysOpen then
52+ for k , v in pairs (SpawnedTrapperBilps ) do
53+ Citizen .InvokeNative (0x662D364ABF16DE2F , v , joaat (' BLIP_MODIFIER_MP_COLOR_8' ))
54+ end
55+ return
56+ end
57+ -- Check if AlwaysOpen is false then check hours
58+ if Config .AlwaysOpen == false then
5759 local hour = GetClockHours ()
5860 if (hour < Config .OpenTime ) or (hour >= Config .CloseTime ) then
5961 for k , v in pairs (SpawnedTrapperBilps ) do
@@ -62,14 +64,17 @@ local GetTrapperHours = function()
6264 else
6365 for k , v in pairs (SpawnedTrapperBilps ) do
6466 Citizen .InvokeNative (0x662D364ABF16DE2F , v , joaat (' BLIP_MODIFIER_MP_COLOR_8' ))
67+ end
6568 end
6669 end
6770end
71+
6872-- get shop hours on player loading
6973RegisterNetEvent (' RSGCore:Client:OnPlayerLoaded' , function ()
7074 GetTrapperHours ()
7175end )
72- -- update shop hourse every min
76+
77+ -- update shop hours every min
7378CreateThread (function ()
7479 while true do
7580 GetTrapperHours ()
0 commit comments