Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SuelTheDev committed Sep 30, 2023
1 parent d7d85b7 commit f2c2a2a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,14 @@ local newWeatherTimer = Config.NewWeatherTimer
--- @param src string | number - source to check
--- @return int - source
local function getSource(src)
if src == '' then
return 0
end
return src
return src == '' and 0 or src
end

--- Does source have permissions to run admin commands
--- @param src number - Source to check
--- @return boolean - has permission
local function isAllowedToChange(src)
if src == 0 or QBCore.Functions.HasPermission(src, "admin") or IsPlayerAceAllowed(src, 'command') then
return true
end
return false
return src == 0 or QBCore.Functions.HasPermission(src, "admin") or IsPlayerAceAllowed(src, 'command')
end

--- Sets time offset based on minutes provided
Expand Down

0 comments on commit f2c2a2a

Please sign in to comment.