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 -.-