Jump to content

OpleX

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by OpleX

  1. i just used the example from the wiki to check if it will work , but apparently it didn't show anything on the Debug ..however , i need to create a avatar system that make the players code upload their avatars through URL and then it download for all the server so that it will be shown for everyone , i hope you get what i mean .. thanks for help .. i really appreciate that .
  2. hi , i just started use fetchRemote and i tried the example from the wiki ( the image one ) , but it didn't work although the url is working .. -- server function ShowImage (player) outputChatBox ( "event called, fetching image..." ) fetchRemote ( "https://img.icons8.com/cotton/2x/baby.png", function ( response, error ) if error == 0 then if player then triggerClientEvent ( player, "onClientGotImage", player, response ) outputChatBox ( "data sucessfully send to the player" ) else outputChatBox ( "bad argument (player) ("..tostring(player)..")" ) end else outputChatBox ( "error "..error.." when fetching image." ) end end ) end addEventHandler("onResourceStart",root,ShowImage) --- client local myTexture addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", root, function( pixels ) outputChatBox ( "client: ok." ) if myTexture and isElement ( 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 ) it says data has been sent but nothing happens thanks in advance
×
×
  • Create New...