This is how I had it written..
Server:
function download()
local open = fileOpen("BUyJfGFCMAEe5BI.jpg")
local content = fileRead("BUyJfGFCMAEe5BI.jpg", fileGetSize("BUyJfGFCMAEe5BI.jpg")) -- if you wanna open huge files, use a smaller buffer instead to save memory
triggerLatentClientEvent(source, "runMod", resourceRoot, content)
end
addCommandHandler("dicks", download)
Client
addEvent("runMod", true)
function runMod()
local hfile = fileOpen("BUyJfGFCMAEe5BI.jpg", false)
if hfile then
outputDebugString("You have it")
else
fileCreate("BUyJfGFCMAEe5BI.jpg")
fileWrite(hfile, content)
outputDebugString("Done")
end
end
addEventHandler("runMod", resourceRoot, runMod)
I am getting errors from Server Side saying bad file pointer. Also Expected String at Argument 1 got nil. For triggerLatentEvent
Thats simply to download it, not to apply anything