ozulus Posted August 18, 2015 Posted August 18, 2015 (edited) SOLVED Edited February 28, 2016 by Guest
ozulus Posted August 19, 2015 Author Posted August 19, 2015 (edited) SOLVED Edited February 28, 2016 by Guest
ozulus Posted August 19, 2015 Author Posted August 19, 2015 (edited) SOLVED Edited February 28, 2016 by Guest
t3wz Posted August 19, 2015 Posted August 19, 2015 try this: server: function onWin (winner) outputChatBox ( "event called, fetching image..." ) fetchRemote ( "http://i.hizliresim.com/Po0XD7.jpg", function ( response, error ) if error == 0 then if winner then triggerClientEvent ( winner, "onClientGotImage", winner, response ) outputChatBox ( "data sucessfully send to the winner" ) else outputChatBox ( "bad argument (winner) ("..tostring(winner)..")" ) end else outputChatBox ( "error "..error.." when fetching image." ) end end ) end addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",root,onWin) 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 ) basically i only changed resourceRoot to root in the client script (line 4) also i've added some debug texts, if that doesn't work make sure onPlayerDestructionDerbyWin is called somewhere.
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