Skip to content

Commit

Permalink
fix version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Blumlaut committed Jan 26, 2019
1 parent 0eeed3a commit 79b0dc5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions admin_server.lua
Expand Up @@ -570,18 +570,21 @@ Citizen.CreateThread(function()
local updatePath = "/Bluethefurry/EasyAdmin"
local resourceName = "EasyAdmin ("..GetCurrentResourceName()..")"
function checkVersion(err,response, headers)
local data = json.decode(response)


if curVersion ~= data.version and tonumber(curVersion) < tonumber(data.version) then
print("\n--------------------------------------------------------------------------")
print("\n"..resourceName.." is outdated.\nCurrent Version: "..data.version.."\nYour Version: "..curVersion.."\nPlease update it from https://github.com"..updatePath.."")
print("\nUpdate Changelog:\n"..data.changelog)
print("\n--------------------------------------------------------------------------")
elseif tonumber(curVersion) > tonumber(data.version) then
print("Your version of "..resourceName.." seems to be higher than the current version.")
if err ~= 200 then
local data = json.decode(response)
if curVersion ~= data.version and tonumber(curVersion) < tonumber(data.version) then
print("\n--------------------------------------------------------------------------")
print("\n"..resourceName.." is outdated.\nCurrent Version: "..data.version.."\nYour Version: "..curVersion.."\nPlease update it from https://github.com"..updatePath.."")
print("\nUpdate Changelog:\n"..data.changelog)
print("\n--------------------------------------------------------------------------")
elseif tonumber(curVersion) > tonumber(data.version) then
print("Your version of "..resourceName.." seems to be higher than the current version.")
else
print(resourceName.." is up to date!")
end
else
print(resourceName.." is up to date!")
print("EasyAdmin Version Check failed!")
end
local nativeuitest = LoadResourceFile("NativeUI", "__resource.lua")
if not nativeuitest then
Expand Down

0 comments on commit 79b0dc5

Please sign in to comment.