GamerDeMTA Posted June 16, 2013 Share Posted June 16, 2013 Hi, I want to do that when the resource starts in the client (onClientResourceStart), there's a image for only 5 first seconds. how?? Link to comment
Moderators IIYAMA Posted June 16, 2013 Moderators Share Posted June 16, 2013 addEventHandler("onClientResourceStart",resourceRoot, function () end) https://wiki.multitheftauto.com/wiki/DxDrawImage https://wiki.multitheftauto.com/wiki/OnClientRender https://wiki.multitheftauto.com/wiki/SetTimer or https://wiki.multitheftauto.com/wiki/GetTickCount Link to comment
GamerDeMTA Posted June 16, 2013 Author Share Posted June 16, 2013 thanks where I put the setTimer?? inside the function? Link to comment
iPrestege Posted June 16, 2013 Share Posted June 16, 2013 addEventHandler("onClientResourceStart",resourceRoot, function () end) https://wiki.multitheftauto.com/wiki/DxDrawImage https://wiki.multitheftauto.com/wiki/OnClientRender https://wiki.multitheftauto.com/wiki/SetTimer or https://wiki.multitheftauto.com/wiki/GetTickCount What about : guiCreateStaticImage setTimer destroyElement Link to comment
Moderators IIYAMA Posted June 16, 2013 Moderators Share Posted June 16, 2013 @#Mr.Pres[T]ege Also possible. thanks where I put the setTimer?? inside the function? Maybe you have to learn lua a little bit more. We are here to help you, not to make it for you. Take a better look at the wiki mta samples. function A () end addEventHandler("onClientResourceStart",resourceRoot, function () setTimer (A,5000,1) --5000 = 5 seconds, 1 = one time executed. --add static image here end) Link to comment
GamerDeMTA Posted June 16, 2013 Author Share Posted June 16, 2013 yes i know. But I only need where I `put the static image? In the second function you say put it there but for what is the function A then Link to comment
iPrestege Posted June 16, 2013 Share Posted June 16, 2013 addEventHandler('onClientResourceStart',resoueceRoot, function ( ) -- CreateImage -- setTimer -- isElement -- destroyElement end ) Complete it. Link to comment
GamerDeMTA Posted June 16, 2013 Author Share Posted June 16, 2013 addEventHandler("onClientResourceStart", resourceRoot, function ( ) guiCreateStaticImage( 20, 200, 100, 100, "img.png", false ) setTimer(5000,1) end ) I only know that, I dont know what i need to put in isElement and destroyElement Link to comment
iPrestege Posted June 16, 2013 Share Posted June 16, 2013 addEventHandler("onClientResourceStart", resourceRoot, function ( ) guiCreateStaticImage( 20, 200, 100, 100, "img.png", false ) setTimer(5000,1) end ) I only know that, I dont know what i need to put in isElement and destroyElement addEventHandler('onClientResourceStart',resourceRoot, function ( ) local aImage = guiCreateStaticImage( 20, 200, 100, 100, "img.png", false ) setTimer( function ( ) if isElement ( aImage ) and guiGetVisible ( aImage ) then destroyElement ( aImage ) aImage = nil end end,5000,1 ) 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