#RooTs Posted March 18, 2016 Share Posted March 18, 2016 is that a good guy can make a table for me to add multiple images? example table,{ image01 = "http://www.example.com/image.jpg", image02 = "http://www.example.com/image2.jpg", image03 = "http://www.example.com/image3.jpg", } all my code server.lua function startImageDownload( playerToReceive ) fetchRemote ( "http://www.example.com/image.jpg", myCallback, "", false, playerToReceive ) end function myCallback( responseData, errno, playerToReceive ) if errno == 0 then triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData ) end end client.lua addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", resourceRoot, function( pixels ) if myTexture then destroyElement( myTexture ) end myTexture = dxCreateTexture( pixels ) end ) addEventHandler("onClientRender", root, function() if myTexture then local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture ) end end ) Link to comment
Dimos7 Posted March 18, 2016 Share Posted March 18, 2016 local images ={ {"", 1} } function startDownloadImage(playerToReceive) for i = 1 , #images do fetchRemote(images, myCallback, "", false, playerdToReceive) end end function myCallback(responseData, errno, playerToReceive) if errno == 0 then triggerClientEvent(playerToReceive, "onClientGotImage", resourceRoot, responseData) end end Link to comment
#RooTs Posted March 18, 2016 Author Share Posted March 18, 2016 and clientSide ? dxDrawImage( 200, 100, w, h, myTexture1 )--?? dxDrawImage( 200, 100, w, h, myTexture2 ) dxDrawImage( 200, 100, w, h, myTexture3 ) Link to comment
Dimos7 Posted March 18, 2016 Share Posted March 18, 2016 I don't think so but i am not sure Link to comment
Captain Cody Posted March 18, 2016 Share Posted March 18, 2016 dxDrawImage is indeed clientSide. If you were asking. But now realizing what you may have been asking you wanna send the response data client side, and define it client side. Link to comment
#RooTs Posted March 18, 2016 Author Share Posted March 18, 2016 the table need to both sides. client and server Link to comment
Enargy, Posted March 18, 2016 Share Posted March 18, 2016 local images ={ {"", 1} } function startDownloadImage(playerToReceive) for i = 1 , #images do fetchRemote(images, myCallback, "", false, playerdToReceive) end end function myCallback(responseData, errno, playerToReceive) if errno == 0 then triggerClientEvent(playerToReceive, "onClientGotImage", resourceRoot, responseData) end end fetchRemote(images[i], myCallback, "", false, playerdToReceive) Link to comment
#RooTs Posted March 18, 2016 Author Share Posted March 18, 2016 @Gaberiel, you can create table in clientSide? Link to comment
Captain Cody Posted March 18, 2016 Share Posted March 18, 2016 Yes you can create a table client side, it's a shared function. Link to comment
#RooTs Posted March 18, 2016 Author Share Posted March 18, 2016 Yes you can create a table client side, it's a shared function. I do not know how do Link to comment
Captain Cody Posted March 18, 2016 Share Posted March 18, 2016 Table = {} Table["Value"] = value Link to comment
#RooTs Posted March 19, 2016 Author Share Posted March 19, 2016 Table = {} Table["Value"] = value this did not help me at all Link to comment
Captain Cody Posted March 19, 2016 Share Posted March 19, 2016 You define the table with Table = {} then set the values with Table["Value"] = value you'd like then load them with value = Table ["Value"] Link to comment
#RooTs Posted March 19, 2016 Author Share Posted March 19, 2016 You define the table withTable = {} then set the values with Table["Value"] = value you'd like then load them with value = Table ["Value"] ?? dxDrawImage( 200, 100, w, h, Table["Value"] ) boy ... much do it for me? my god... 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