forked from DevBlocky/nearest-postal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsv.lua
35 lines (34 loc) · 819 Bytes
/
sv.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-- version check
Citizen.CreateThread(
function()
local vRaw = LoadResourceFile(GetCurrentResourceName(), 'version.json')
if vRaw and config.versionCheck then
local v = json.decode(vRaw)
PerformHttpRequest(
'https://raw.githubusercontent.com/blockba5her/nearest-postal/master/version.json',
function(code, res, headers)
if code == 200 then
local rv = json.decode(res)
if rv.version ~= v.version then
print(
([[
-------------------------------------------------------
nearest-postal
UPDATE: %s AVAILABLE
CHANGELOG: %s
-------------------------------------------------------
]]):format(
rv.version,
rv.changelog
)
)
end
else
print('nearest-postal unable to check version')
end
end,
'GET'
)
end
end
)