-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathversion_check.lua
61 lines (55 loc) · 2.41 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-------------------------------------------------------------
-- Calm-AI V3- A Simple FiveM Script, Made By Jordan.#2139 --
-------------------------------------------------------------
----------------------------------------------------------------------------------------------
-- !WARNING! !WARNING! !WARNING! !WARNING! !WARNING! --
-- DO NOT TOUCH THIS FILE OR YOU /WILL/ FUCK SHIT UP! EDIT THE CONFIG.LUA --
-- DO NOT BE STUPID AND WHINE TO ME ABOUT THIS BEING BROKEN IF YOU TOUCHED THE LINES BELOW. --
----------------------------------------------------------------------------------------------
local label =
[[
//
||
||
|| ______ __ ___ ____ _ _______
|| / ____/___ _/ /___ ___ / | / _/ | | / /__ /
|| / / / __ `/ / __ `__ \______/ /| | / / | | / / /_ <
|| / /___/ /_/ / / / / / / /_____/ ___ |_/ / | |/ /___/ /
|| \____/\__,_/_/_/ /_/ /_/ /_/ |_/___/ |___//____/
||
||
|| Created by Jordan.#2139
||]]
Citizen.CreateThread(function()
local CurrentVersion = GetResourceMetadata(GetCurrentResourceName(), 'version', 0)
if not CurrentVersion then
print('^1Calm-AI V3 Version Check Failed!^7')
end
function VersionCheckHTTPRequest()
PerformHttpRequest('https://raw.githubusercontent.com/Jordan2139/versions/master/calmv3.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 || Calm-AI V3 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(' || ^2Calm-AI V3 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 Jordan.#2139 on Discord.\n^0 ||\n \\\\\n')
end
SetTimeout(60000000, VersionCheckHTTPRequest)
end
VersionCheckHTTPRequest()
end)