Skip to content

Commit

Permalink
Update main.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrachStack authored Sep 19, 2023
1 parent 5502448 commit baf823c
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,52 @@ RegisterNetEvent('kezi:moneywash', function(amount, playerCoords)
end)

function startup()
print("[KZ] Kezi-Moneywash has started. | Version 1.0.4")
print("[Zaps] QB-Moneywash has started. | Version 6.2")
end
function zapsupdatee()
local githubRawUrl = "https://raw.githubusercontent.com/Zaps6000/base/main/api.json"
local resourceName = "moneywash"

PerformHttpRequest(githubRawUrl, function(statusCode, responseText, headers)
if statusCode == 200 then
local responseData = json.decode(responseText)

if responseData[resourceName] then
local remoteVersion = responseData[resourceName].version
local description = responseData[resourceName].description
local changelog = responseData[resourceName].changelog

local manifestVersion = GetResourceMetadata(GetCurrentResourceName(), "version", 0)

print("Resource: " .. resourceName)
print("Manifest Version: " .. manifestVersion)
print("Remote Version: " .. remoteVersion)
print("Description: " .. description)

if manifestVersion ~= remoteVersion then
print("Status: Out of Date (New Version: " .. remoteVersion .. ")")
print("Changelog:")
for _, change in ipairs(changelog) do
print("- " .. change)
end
print("Link to Updates: https://zaps6000.tebex.io/ https://discord.gg/cfxdev")
else
print("Status: Up to Date")
end
else
print("Resource name not found in the response.")
end
else
print("HTTP request failed with status code: " .. statusCode)
end
end, "GET", nil, json.encode({}), {})
end

AddEventHandler('onResourceStart', function(resource)
if resource == GetCurrentResourceName() then
startup()
zapsupdatee()
end
end)


0 comments on commit baf823c

Please sign in to comment.