Skip to content

Commit

Permalink
easytime - v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RampBST committed Dec 27, 2021
1 parent 3e7c6a6 commit c11861c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
11 changes: 8 additions & 3 deletions client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ end)

local self = {}
self.seconds = 0
self.tsunami = false
local NUI_status = false
local PauseSync = {}
PauseSync.state = false
Expand Down Expand Up @@ -136,7 +137,11 @@ AddEventHandler('cd_easytime:ForceUpdate', function(data)
self.blackout = data.blackout
ChangeBlackout(self.blackout)
end
end
end
if data.tsunami ~= nil and Config.TsunamiWarning and self.tsunami ~= data.tsunami then
self.tsunami = data.tsunami
TriggerEvent('cd_easytime:StartTsunamiCountdown', data.tsunami)
end
end)

RegisterNetEvent('cd_easytime:SyncWeather')
Expand Down Expand Up @@ -199,8 +204,8 @@ RegisterNUICallback('change', function(data)
NUI_status = false
TriggerServerEvent('cd_easytime:ForceUpdate', data.values)
if data.savesettings then
print('Saving Settings - please wait 3 seconds ...')
Wait(3000)
print('Saving Settings - please wait 2 seconds ...')
Wait(2000)
TriggerServerEvent('cd_easytime:SaveSettings')
print('Settings Saved.')
end
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fx_version 'cerulean'
game 'gta5'
author 'Codesign#2715'
description 'Codesign Weather & Time Managment'
version '1.3.1'
version '1.3.2'

shared_scripts {
'configs/locales.lua',
Expand Down
9 changes: 4 additions & 5 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end)
RegisterServerEvent('cd_easytime:SyncMe')
AddEventHandler('cd_easytime:SyncMe', function(instant)
local _source = source
local temp = self
local temp = json.decode(json.encode(self))
temp.instanttime = true
temp.instantweather = true
TriggerClientEvent('cd_easytime:ForceUpdate', _source, temp)
Expand Down Expand Up @@ -114,11 +114,10 @@ AddEventHandler('cd_easytime:ForceUpdate', function(data)
if data.instantweather ~= nil then
self.instantweather = data.instantweather
end
TriggerClientEvent('cd_easytime:ForceUpdate', -1, data)
if data.tsunami ~= nil and Config.TsunamiWarning then
self.tsunami = data.tsunami
TriggerClientEvent('cd_easytime:StartTsunamiCountdown', -1, data.tsunami)
end
TriggerClientEvent('cd_easytime:ForceUpdate', -1, data)
else
DropPlayer(_source, L('drop_player'))
end
Expand All @@ -138,7 +137,7 @@ local function LoadSettings()
print('^3['..resource_name..'] - Saved settings applied.^0')
if Config.Framework ~= 'vrp' or Config.Framework ~= 'aceperms' then
Wait(2000)
local temp = self
local temp = json.decode(json.encode(self))
temp.instanttime = true
temp.instantweather = true
TriggerClientEvent('cd_easytime:ForceUpdate', -1, temp)
Expand Down Expand Up @@ -293,7 +292,7 @@ function PermissionsCheck(source)
end
return false

elseif Config.Framework == 'qbus' then
elseif Config.Framework == 'qbcore' then
local xPlayer = QBCore.Functions.GetPlayer(source)
local perms = QBCore.Functions.GetPermission(source)
for c, d in pairs(Config.Command.Perms[Config.Framework]) do
Expand Down

0 comments on commit c11861c

Please sign in to comment.