Jump to content

fetchRemote Help !


Tremidinha

Recommended Posts

Posted

Hi I have a problem with the function fetchRemote. I hope you can help me.

Server Side:

function startImageDownload( playerToReceive ) 
    fetchRemote ( "www.exemple.com/exemple.png", myCallback, "", false, playerToReceive ) 
end 
addCommandHandler("down",startImageDownload) 
  
function myCallback( responseData, errno, playerToReceive ) 
    if errno == 0 then 
        triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData ) 
    end 
end 
  

Client Side:

addEvent( "onClientGotImage", true ) 
addEventHandler( "onClientGotImage", resourceRoot, 
    function( pixels ) 
        local file = fileCreate( pixels..".png" ) 
        if ( file ) then 
            outputChatBox("Test") 
            fileWrite( file, pixels );  
            fileClose( file ); 
        end 
    end 
) 
  

I think the code is right but there appears no error and the file is not created, someone could help me or explain to me why this happens?

Email - [email protected]

Skype - mattheusxdx

Posted

Didn't I just tell you million times that it's not:

pixels .. ".png" 

But:

"file.png" 

?

Is it that hard to understand that?

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...