eSPeZet Posted October 24, 2018 Share Posted October 24, 2018 (edited) Hello, can anyone explain why the following code doesn't run? addEventHandler("onClientResourceStart", resourceRoot, function() myRenderTarget = dxCreateRenderTarget( 80, 100 ) dxSetRenderTarget( myRenderTarget ) dxDrawRectangle ( 2, 2, 60, 60, tocolor(255,255,0) ) dxDrawText ( "Hello", 10, 20 ) dxDrawText ( "Yoo", 10, 40 ) dxDrawText ( "Ffs", 10, 60 ) dxSetRenderTarget() end ) addEventHandler( "onClientRender", root, function() if myRenderTarget then dxDrawImage ( 100, 200, 80, 100, myRenderTarget ) end end ) This should definitely work, but somehow it ONLY works when the whole code is in 'onClientRender'. And if i am wrong with that, then also all the documentations of MTA-wiki would be wrong Yes I got enough free RAM.. My fk*** god...tried to solve it for hours before I created the post..RESTARTING the resource ingame HELPED! I did it from the console all the time -.- Edited October 24, 2018 by eSPeZet solved Link to comment
idarrr Posted October 26, 2018 Share Posted October 26, 2018 On 25/10/2018 at 05:26, eSPeZet said: My fk*** god...tried to solve it for hours before I created the post..RESTARTING the resource ingame HELPED! I did it from the console all the time -.- Maybe because you are using ALT + TAB and this will clear all render target. https://wiki.multitheftauto.com/wiki/OnClientRestore 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