Turbesz Posted July 22, 2016 Share Posted July 22, 2016 setTimer(function () local amount = math.random(0,3000) for id, player in ipairs(getElementsByType("player")) do givePlayerMoney ( player, amount ) outputChatBox (#c4ff00Fizetésed megérkezett #00baff: #00ff00"..amount.."#00ff00$!!", player, 255, 255, 255, true ) end end,60000,0) the text jump up for 5 seconds then hide, how? Link to comment
Bonsai Posted July 22, 2016 Share Posted July 22, 2016 Try it yourself first, then come back.. Link to comment
EstrategiaGTA Posted July 22, 2016 Share Posted July 22, 2016 There are no dx functions in that code... Link to comment
Turbesz Posted July 22, 2016 Author Share Posted July 22, 2016 local screenWidth, screenHeight = guiGetScreenSize ( ) -- Get the screen resolution (width and height) function createText ( ) setTimer(function () local amount = math.random(0,3000) for id, player in ipairs(getElementsByType("player")) do givePlayerMoney ( player, amount ) end end,60000,0) -- Draw zone name text's shadow. dxDrawText ( amount, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" ) -- Draw zone name text. dxDrawText ( amount, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender. end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) like this (?) or i dont know :c Link to comment
EstrategiaGTA Posted July 22, 2016 Share Posted July 22, 2016 Draw the text with onClientRender + addEventHandler, and use a setTimer for 5 seconds (5000ms) with onClientRender + removeEventHandler- Link to comment
Turbesz Posted July 22, 2016 Author Share Posted July 22, 2016 Huh, how? Me very very noob thereunto:( Link to comment
Simple0x47 Posted July 22, 2016 Share Posted July 22, 2016 Start to make things on your own and don't steal from others one Link to comment
EstrategiaGTA Posted July 22, 2016 Share Posted July 22, 2016 Start to make things on your own and don't steal from others one He didn't steal anything, he posted an example from the Wiki. Turbo, I'll give you an example which would work with the Wiki example you posted... Adding this line to the end of the code, the dx Text would disappear within 5 seconds after the resource is started. setTimer(removeEventHandler,5000,1,"onClientRender", root, createText) Link to comment
Turbesz Posted July 22, 2016 Author Share Posted July 22, 2016 Start to make things on your own and don't steal from others one He didn't steal anything, he posted an example from the Wiki. Turbo, I'll give you an example which would work with the Wiki example you posted... Adding this line to the end of the code, the dx Text would disappear within 5 seconds after the resource is started. setTimer(removeEventHandler,5000,1,"onClientRender", root, createText) doesn't working, but unimportant 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