Vector Posted August 26, 2013 Share Posted August 26, 2013 (edited) Hi, I try to use fetchRemote in client-side but it doesnt work. in fact, it works when using fetchRemote in server-side I used to think that this error is because of client or server version are below the minimum required version. But I put this on the meta file, and stil the same error. client="1.3.2" server="1.3.0-9.03739"/> this works -> --server-side fetchRemote("http://localhost/image.png", function(data, errno) if errno == 0 then outputChatBox("error downloading image: " .. errno); return; end; triggerClientEvent(root, "onFileDownload", root, "image.png", data); end); -- client-side addEvent("onFileDownload", true); addEventHandler("onFileDownload", root, function(fileName, data) -- cache the data to a file .. local file; if not fileExists(fileName) then file = fileCreate(fileName); else file = fileOpen(fileName); end; fileWrite(file, data); fileClose(file); -- do whatever with the file ... end); this not work-> (value returned by fetchRemote -> error 1006) --client-side fetchRemote("http://localhost/image.png", function(data, errno) if errno == 0 then outputChatBox("error downloading image: " .. errno); return; end; triggerEvent("onFileDownload", root, "image.png", data); end); addEvent("onFileDownload", false); addEventHandler("onFileDownload", root, function(fileName, data) -- cache the data to a file .. local file; if not fileExists(fileName) then file = fileCreate(fileName); else file = fileOpen(fileName); end; fileWrite(file, data); fileClose(file); -- do whatever with the file ... end); help please. Edited August 26, 2013 by Guest Link to comment
csiguusz Posted August 26, 2013 Share Posted August 26, 2013 From the wiki: Note: Client side function only works with the server the player is connected to Use server IP or hostname of the server wich the client is connected to on client-side. Eg.: fetchRemote("http://1.2.3.4/image.png", Link to comment
Vector Posted August 26, 2013 Author Share Posted August 26, 2013 I tried to use server-ip like this "http://x.x.x.x/image.png" and doesn´t work. and with a hostname like myserver.no-ip.org "http://myserver.no-ip.org/image" doesnt´work. error 1006 Link to comment
xXMADEXx Posted August 26, 2013 Share Posted August 26, 2013 I tried to use server-ip like this "http://x.x.x.x/image.png" and doesn´t work.and with a hostname like myserver.no-ip.org "http://myserver.no-ip.org/image" doesnt´work. error 1006 As csiguusz said, fetchRemote on the client side will only work to connect to the server. You cannot connect to servers that aren't hosted on the servers computer Link to comment
Vector Posted August 26, 2013 Author Share Posted August 26, 2013 the server i try to connect to is the same server the client is connected to in MTA. Link to comment
Castillo Posted August 26, 2013 Share Posted August 26, 2013 Well, for what it seems is that the IP you entered is not allowed. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now