forked from overextended/ox_inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.lua
17 lines (16 loc) · 837 Bytes
/
version.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if ox.versioncheck then
CreateThread(function()
Wait(1000)
local resource = GetCurrentResourceName()
local url = GetResourceMetadata(resource, 'repository', 0)
local version = GetResourceMetadata(resource, 'version', 0)
PerformHttpRequest(('%s/master/fxmanifest.lua'):format(url:gsub('github.com', 'raw.githubusercontent.com')), function(error, response)
if error == 200 and response then
local latest = response:match('%d%.%d+%.%d+')
if version < latest then
print(('^3An update is available for ox_inventory - please download the latest release (current version: %s)\n ^3- https://github.com/overextended/ox_inventory/releases^0'):format(latest, version))
end
end
end, 'GET')
end)
end