PlayAkoya Posted September 10, 2015 Share Posted September 10, 2015 Hi, Load images from website? For recordable from Google Images: http://www.next-gamer.de/wp-content/upl ... /url17.jpg --Useful Function: function getImageFromWebsite(url) if (url) then local getImageData = --[FUNCTION give the image?? HELP ME pls..] else local getImageData = nil end return getImageData end guiCreateStaticImage(0, 0, 500, 281, tostring(getImageFromWebsite), true) Hope someone here has a chance? Link to comment
PlayAkoya Posted September 10, 2015 Author Share Posted September 10, 2015 Sorry , I 've looked at fetchRemote and find the Wiki in confusing you could give me in implementing my idea help I would probably need to days for the test, and find out how I need scripts . fetchRemote Link to comment
JR10 Posted September 10, 2015 Share Posted September 10, 2015 Server: local img_data addEventHandler('onResourceStart', resourceRoot, function() fetchRemote('http://www.next-gamer.de/wp-content/uploads/2015/05/url17.jpg', function(data, err) if (err ~= 0) then return end img_data = data end) end) addEventHandler('onPlayerJoin', root, function() if (not img_data) then return end triggerClientEvent(source, 'drawImage', resourceRoot) end) Now image data is a string, you can trigger the string to the client and then use dxCreateTexture and dxDrawImage to draw it. local texture addEvent('drawImage', true) addEventHandler('drawImage', root, function(img_data) texture = dxCreateTexture(img_data) if (not texture) then return end addEventHandler('onClientRender', root, drawTexture) end) function drawTexture() dxDrawImage(0, 0, 320, 240, texture) end 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