mirror of
https://github.com/jimathy/rpemotes.git
synced 2026-03-31 06:33:51 -04:00
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
26 lines
1.1 KiB
Lua
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
|