Skip to content

Instantly share code, notes, and snippets.

@ImXirvin
Created December 28, 2022 10:56
Show Gist options
  • Save ImXirvin/289f6464ea8b8bb773a031051ff0efb6 to your computer and use it in GitHub Desktop.
Save ImXirvin/289f6464ea8b8bb773a031051ff0efb6 to your computer and use it in GitHub Desktop.
CFX Standalone Version Checker
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