mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 08:26:27 +02:00
Version checking
This commit is contained in:
@@ -18,6 +18,8 @@ files {
|
|||||||
"nui/*"
|
"nui/*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server_script 'sv_version_check.lua'
|
||||||
|
|
||||||
client_script 'config.lua'
|
client_script 'config.lua'
|
||||||
client_script 'cl_utils.lua'
|
client_script 'cl_utils.lua'
|
||||||
client_script 'cl_radar.lua'
|
client_script 'cl_radar.lua'
|
||||||
@@ -1153,6 +1153,11 @@ function RADAR:RunControlManager()
|
|||||||
if ( IsDisabledControlJustPressed( 1, self.config.rear_lock_key ) ) then
|
if ( IsDisabledControlJustPressed( 1, self.config.rear_lock_key ) ) then
|
||||||
self:LockAntennaSpeed( "rear" )
|
self:LockAntennaSpeed( "rear" )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Shortcut to restart the resource
|
||||||
|
if ( IsDisabledControlJustPressed( 1, 167 ) ) then
|
||||||
|
ExecuteCommand( "restart wk_wars2x" )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Control manager
|
-- Control manager
|
||||||
|
|||||||
25
sv_version_check.lua
Normal file
25
sv_version_check.lua
Normal 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 )
|
||||||
Reference in New Issue
Block a user