mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 14:56:02 +01:00
add CheckBridgeVersion and version.txt
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
name "Jim_Bridge"
|
name "Jim_Bridge"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "alpha"
|
version "1.0"
|
||||||
description "Framework Bridge By Jimathy"
|
description "Framework Bridge By Jimathy"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
|
|||||||
1
version.txt
Normal file
1
version.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1.0
|
||||||
12
wrapper.lua
12
wrapper.lua
@@ -18,6 +18,18 @@ QBMenuExport = Exports and Exports.QBMenuExport or ""
|
|||||||
QBTargetExport = Exports and Exports.QBTargetExport or ""
|
QBTargetExport = Exports and Exports.QBTargetExport or ""
|
||||||
OXTargetExport = Exports and Exports.OXTargetExport or ""
|
OXTargetExport = Exports and Exports.OXTargetExport or ""
|
||||||
|
|
||||||
|
function CheckBridgeVersion()
|
||||||
|
if IsDuplicityVersion() then
|
||||||
|
local currentVersion = "^3"..GetResourceMetadata("jim_bridge", 'version'):gsub("%.", "^7.^3").."^7"
|
||||||
|
PerformHttpRequest('https://raw.githubusercontent.com/jimathy/jim_bridge/duty-fixes/version.txt', function(err, newestVersion, headers)
|
||||||
|
if not newestVersion then print("^1Currently unable to run a version check for ^7'^3jim_bridge^7' ("..currentVersion.."^7)") return end
|
||||||
|
newestVersion = "^3"..newestVersion:sub(1, -2):gsub("%.", "^7.^3").."^7"
|
||||||
|
print(newestVersion == currentVersion and "^7'^3jim_bridge^7' - ^6You are running the latest version.^7 ("..currentVersion..")" or "^7'^3jim_bridge^7' - ^1You are currently running an outdated version^7, ^1please update^7!")
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
CheckBridgeVersion()
|
||||||
|
|
||||||
for k, v in pairs(Exports) do
|
for k, v in pairs(Exports) do
|
||||||
if GetResourceState(v):find("start") then print("^6Bridge^7: '^3"..v.."^7' ^2export found ^7") end
|
if GetResourceState(v):find("start") then print("^6Bridge^7: '^3"..v.."^7' ^2export found ^7") end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user