Files
rpemotes/server/Updates.lua
DogsGoBark d1339ba7de Various Fixes (#3)
* Update fxmanifest.lua

* Rename Config.lua to config.lua

* Update Walk.lua

* Update Syncing.lua

* Update Ragdoll.lua

* Update Keybinds.lua

* Update Emote.lua

* Update and rename Client/AnimationList.lua to client/AnimationList.lua

* Rename Client/Emote.lua to client/Emote.lua

* Rename Client/EmoteMenu.lua to client/EmoteMenu.lua

* Rename Client/Keybinds.lua to client/Keybinds.lua

* Rename Client/Ragdoll.lua to client/Ragdoll.lua

* Rename Client/Syncing.lua to client/Syncing.lua

* Rename Client/Walk.lua to client/Walk.lua

* Rename Server/Server.lua to server/Server.lua

* Rename Server/Updates.lua to server/Updates.lua
2021-12-19 02:36:55 +13:00

34 lines
1.6 KiB
Lua

if Config.CheckForUpdates then
Citizen.CreateThread( function()
updatePath = "/andristum/dpemotes"
resourceName = "dp Emotes ("..GetCurrentResourceName()..")"
PerformHttpRequest("https://raw.githubusercontent.com"..updatePath.."/master/version", checkVersion, "GET")
end)
end
RegisterServerEvent("dp:CheckVersion")
AddEventHandler("dp:CheckVersion", function()
if updateavail then
TriggerClientEvent("dp:Update", source, true)
else
TriggerClientEvent("dp:Update", source, false)
end
end)
function checkVersion(err,responseText, headers)
curVersion = LoadResourceFile(GetCurrentResourceName(), "version")
if curVersion ~= responseText and tonumber(curVersion) < tonumber(responseText) then
updateavail = true
print("\n^1----------------------------------------------------------------------------------^7")
print(resourceName.." is outdated, latest version is: ^2"..responseText.."^7, installed version: ^1"..curVersion.."^7!\nupdate from https://github.com"..updatePath.."")
print("^1----------------------------------------------------------------------------------^7")
elseif tonumber(curVersion) > tonumber(responseText) then
print("\n^3----------------------------------------------------------------------------------^7")
print(resourceName.." git version is: ^2"..responseText.."^7, installed version: ^1"..curVersion.."^7!")
print("^3----------------------------------------------------------------------------------^7")
else
print("\n"..resourceName.." is up to date. (^2"..curVersion.."^7)")
end
end