Created
December 28, 2022 10:56
-
-
Save ImXirvin/289f6464ea8b8bb773a031051ff0efb6 to your computer and use it in GitHub Desktop.
CFX Standalone Version Checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CreateThread(function() | |
--version check with github latest version | |
PerformHttpRequest( | |
"https://raw.githubusercontent.com/[User]/[Repo]/main/fxmanifest.lua", | |
function(err, text, headers) | |
if err ~= 200 then | |
return | |
end | |
local version = GetResourceMetadata(GetCurrentResourceName(), "version") | |
local latestVersion = string.match(text, '%sversion \"(.-)\"') | |
if version ~= latestVersion then | |
print("Resource is outdated. Please update " .. GetCurrentResourceName() .. " to the newest version.") | |
end | |
end, | |
"GET" | |
) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment