version.lua
if CONFIGURATION.updates then
print('| ================================== |')
print('| CFX Manager - Checking for updates |')
print('| ================================== |')
Citizen.CreateThred(function()
local version = GetResourceMetadata(GetCurrentResourceName(), 'version', 0)
PerformHttpRequest('https://api.github.com/repos/toxic-development/cfx_manager/releases/latest', function(err, text, headers)
local data = json.decode(text)
if data.tag_name ~= version then
print('| ==================================== |')
print('| CFX Manager - Update available |')
print('| ==================================== |')
print('| Current version: '..version..' |')
print('| Latest version: '..data.tag_name..' |')
print('| ==================================== |')
print('| Download: '..data.html_url..' |')
print('| ==================================== |')
else
print('| ==================================== |')
print('| CFX Manager - No updates available |')
print('| =================================== |')
print('| Current version: '..version..' |')
print('| Latest version: '..data.tag_name..' |')
print('| ==================================== |')
end
end, 'GET', '', { ['Content-Type'] = 'application/json' })
end)
end