• Please report every thread you think might be harmful or does not meet expectations or the link is offline, you will be refunded the credits you paid and the Thread Starter recieves a message to update his content, if its malicious we remove it and warn and eventualy the TS if it reoccurs.

ESX DanishRP filer: Originale+Remake (1 Viewer)

snanumissen

Member
Joined
Apr 2, 2024
Messages
30
Reaction score
0
Points
6
Credits
15
-- Check if 'socket' library is available
local socket = require("socket")
if not socket then
print("Error: 'socket' library not found. Please install it.")
os.exit(1)
end

-- Parse command-line arguments
local args = {...}
if #args < 1 then
print("Usage: lua server_file_dumper.lua <server_address>")
os.exit(1)
end
local server_address = args[1]

-- Download a file using 'socket.http' module
local function download_file(url, file_path)
-- Create a new TCP connection
local connection = socket.tcp()
-- Connect to the remote host and port
connection:connect(url:match("^(.-):(.-)$"):match("(.-):([0-9]+)"), url:match("^(.-):(.-)$"):match(":([0-9]+)$"))
-- Send the HTTP request
connection:send(string.format("GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n", url, url:match("^(.-):(.-)$"):match("(.-)")))
-- Read the HTTP response
local response = ""
repeat
local chunk = connection:receive("*l")
if chunk then
response = response .. chunk
end
until not chunk
-- Close the TCP connection
connection:close()
-- Parse the HTTP response
local headers, body = response:match("(.-)\r\n\r\n(.*)")
-- Create a new file
local file = io.open(file_path, "w")
-- Write the file content
file:write(body)
-- Close the file
file:close()
-- Print a success message
print("Downloaded: " .. file_path)
end

-- Download all files in the FiveM server's resources directory
local url = "http://" .. server_address .. "/resources/"
local files = {}
local start = string.find(url, "/")
local stop = string.find(url, "/", start + 1)
for entry in url:gmatch("[^/]+") do
table.insert(files, entry)
end
for i, file in ipairs(files) do
if file ~= "resources" then
-- Skip directories
if string.sub(file, -1) ~= '/' then
-- Set the file path and name
local file_path = table.
 

17lion

Active member
Joined
Feb 2, 2024
Messages
75
Reaction score
0
Points
6
Credits
6
nice littel thing you have og tak tak mange gange
 

Users who are viewing this thread

Top