This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
version_check.lua
47 lines (43 loc) · 1.91 KB
/
version_check.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
36
37
38
39
40
41
42
43
44
45
46
47
local label =
[[
//
|| ____ _ ____ _ __ ___ __
|| / __ \____ _______________ ____ ____ | | / / /_ (_) /____ / (_)____/ /_
|| / /_/ / __ `/ ___/ ___/ __ \/ __ \/ __ \ | | /| / / __ \/ / __/ _ \/ / / ___/ __/
|| / _, _/ /_/ / /__/ /__/ /_/ / /_/ / / / / | |/ |/ / / / / / /_/ __/ / (__ ) /_
|| /_/ |_|\__,_/\___/\___/\____/\____/_/ /_/ |__/|__/_/ /_/_/\__/\___/_/_/____/\__/
|| Created by TheRaccoon#1023
||]]
Citizen.CreateThread(function()
local CurrentVersion = GetResourceMetadata(GetCurrentResourceName(), 'version', 0)
if not CurrentVersion then
print('^1Raccoon-Whitelist Version Check Failed!^7')
end
function VersionCheckHTTPRequest()
PerformHttpRequest('https://raw.githubusercontent.com/PeEcEeChIP/version-history/version/raccoon-whitelist.json', VersionCheck, 'GET')
end
function VersionCheck(err, response, headers)
Citizen.Wait(3000)
if err == 200 then
local Data = json.decode(response)
if CurrentVersion ~= Data.NewestVersion then
print( label )
print(' || \n || Raccoon-Whitelist is outdated!')
print(' || Current version: ^2' .. Data.NewestVersion .. '^7')
print(' || Your version: ^1' .. CurrentVersion .. '^7')
print(' || Please download the lastest version from ^5' .. Data.DownloadLocation .. '^7')
if Data.Changes ~= '' then
print(' || \n || ^5Changes: ^7' .. Data.Changes .. "\n^0 \\\\\n")
end
else
print( label )
print(' || ^2Raccoon-Whitelist is up to date!\n^0 ||\n \\\\\n')
end
else
print( label )
print(' || ^1There was an error getting the latest version information, if the issue persists contact TheRaccoon#1023 on Discord.\n^0 ||\n \\\\\n')
end
SetTimeout(60000000, VersionCheckHTTPRequest)
end
VersionCheckHTTPRequest()
end)