GamerDeMTA Posted June 16, 2013 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??
Moderators IIYAMA Posted June 16, 2013 Moderators 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 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
GamerDeMTA Posted June 16, 2013 Author Posted June 16, 2013 thanks where I put the setTimer?? inside the function?
iPrestege Posted June 16, 2013 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
Moderators IIYAMA Posted June 16, 2013 Moderators 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) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
GamerDeMTA Posted June 16, 2013 Author 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
iPrestege Posted June 16, 2013 Posted June 16, 2013 addEventHandler('onClientResourceStart',resoueceRoot, function ( ) -- CreateImage -- setTimer -- isElement -- destroyElement end ) Complete it.
GamerDeMTA Posted June 16, 2013 Author 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
iPrestege Posted June 16, 2013 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 )
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