Skip to content

Commit e55d3e8

Browse files
committed
config option for alwaysopen added!
This was requested by one of our members, this now gives the option for the store to always be open, if the config option is set to false, then it continues with its normal logic :)
1 parent 8009b9d commit e55d3e8

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

client/client.lua

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,22 @@ end)
4040
----------------------------------------
4141
-- open store with opening hours
4242
----------------------------------------
43+
----- SCORPION UPDATE 26 March 2025
4344
AddEventHandler('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')
5446
end)
47+
5548
-- get store hours function
5649
local 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
6770
end
71+
6872
-- get shop hours on player loading
6973
RegisterNetEvent('RSGCore:Client:OnPlayerLoaded', function()
7074
GetTrapperHours()
7175
end)
72-
-- update shop hourse every min
76+
77+
-- update shop hours every min
7378
CreateThread(function()
7479
while true do
7580
GetTrapperHours()

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fx_version 'cerulean'
22
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'
33
game 'rdr3'
4-
version '2.0.0'
4+
version '2.0.1'
55

66
quantum_github 'https://github.com/Quantum-Projects-RedM/QC-AdvancedTrapper'
77
author 'Pablo Enterprises'

shared/Config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Config.SpawnDistanceRadius = 30 -- the distance the animal spawns away from the
1010
Config.HideTime = 10000 -- the amount of time in miliseconds that you have to hide before animal aproaches the bait
1111
Config.AnimalWait = 10000 -- the amount of time in miliseconds that the animal will wait at the bait until freeroam
1212
Config.KeyShop = 'J'
13+
Config.AlwaysOpen = true -- set to true to for the store to be always open, false to use the time below [IF TRUE, THE TIME BELOW WILL BE IGNORED]
1314
Config.OpenTime = 9 -- hrs : 24hour clock
1415
Config.CloseTime = 18 -- hrs : 24hour clock
1516
--------------------------------------------

0 commit comments

Comments
 (0)