Version checking

This commit is contained in:
Dan
2019-12-07 19:16:19 +00:00
parent 27b5c68b74
commit 91cafab7f9
3 changed files with 32 additions and 0 deletions

25
sv_version_check.lua Normal file
View File

@@ -0,0 +1,25 @@
--[[-----------------------------------------------------------------------
Wraith ARS 2X
Created by WolfKnight
-----------------------------------------------------------------------]]--
function GetCurrentVersion()
return GetResourceMetadata( GetCurrentResourceName(), "version" )
end
PerformHttpRequest( "https://wolfknight98.github.io/wk_wars2x/docs/version.txt", function( err, text, headers )
Citizen.Wait( 2000 )
local curVer = GetCurrentVersion()
print( "\n//\n|| Current Wraith ARS 2X Version: " .. curVer )
print( "|| Latest Wraith ARS 2X Version: " .. text .."\n||" )
if ( text ~= curVer ) then
print( "|| ^1Your Wraith ARS 2X version is outdated, visit the FiveM forum post to get the latest version.\n^0\\\\" )
else
print( "|| ^2Wraith ARS 2X is up to date!\n^0\\\\" )
end
end )