Files
rpemotes-jimathy/server/Updates.lua
iSentrie e91c0c726c refactor/feat: cleaning, minor fixes, new feature to disable specific emotes in vehicle (#129)
Changes:
• cleaning
• deleted unused code
• indentation fixes
• minor fixes (proper source usage in server side)
• new feature to disable specific emotes from playing  inside an vehicle
2023-01-26 11:25:40 +13:00

26 lines
1.1 KiB
Lua

if Config.CheckForUpdates then
local function VersionLog(_type, log)
local color = _type == 'success' and '^2' or '^1'
print(('^8[rpemotes]%s %s^7'):format(color, log))
end
local function CheckMenuVersion()
PerformHttpRequest('https://raw.githubusercontent.com/TayMcKenzieNZ/rpemotes/master/version.txt', function(err, text, headers)
local currentVersion = GetResourceMetadata(GetCurrentResourceName(), 'version')
if not text then
VersionLog('error', 'Currently unable to run a version check.')
return
end
VersionLog('success', ('Current Version: %s'):format(currentVersion))
VersionLog('success', ('Latest Version: %s'):format(text))
if text:gsub("%s+", "") == currentVersion:gsub("%s+", "") then
VersionLog('success', 'You are running the latest version.')
else
VersionLog('error', ('You are currently running an outdated version, please update to version %s'):format(text))
end
end)
end
CheckMenuVersion()
end