From f9f4056bbf2bf3e93e155dabf803bb373150f1d2 Mon Sep 17 00:00:00 2001 From: Tuncion Date: Sun, 8 Dec 2024 16:49:50 +0100 Subject: [PATCH] Changed version check --- server/main.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/main.lua b/server/main.lua index e35b696..7f79215 100644 --- a/server/main.lua +++ b/server/main.lua @@ -47,6 +47,9 @@ Citizen.CreateThread(function() if ResponseData.tag_name ~= ScriptMetadata.version then print(('\27[1;46m[%s]\27[0m \27[1;37m🎄 A new version ^3%s\27[1;37m is available since ^3%s UTC\27[1;37m.^7'):format(ScriptMetadata.name, ResponseData.tag_name, os.date('%d.%m.%Y %H:%M:%S', ParseISODateString(ResponseData.published_at)))) print(('\27[1;46m[%s]\27[0m \27[1;37mPlease update it on ^5GitHub^7:\27[1;37m %s'):format(ScriptMetadata.name, ResponseData.html_url)) + else + local DownloadCount = ResponseData?.assets?[1]?.download_count or 'few' + print(('\27[1;46m[%s]\27[0m \27[1;37m🎄 You are running the latest version like ^3%s^7\27[1;37m other people 🎅^7'):format(ScriptMetadata.name, DownloadCount)) end else ResponseData = json.decode(ErrorResponse:gsub('HTTP %d+: (.+)', '%1'))