Turbesz Posted July 22, 2016 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?
Turbesz Posted July 22, 2016 Author 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
EstrategiaGTA Posted July 22, 2016 Posted July 22, 2016 Draw the text with onClientRender + addEventHandler, and use a setTimer for 5 seconds (5000ms) with onClientRender + removeEventHandler-
Simple0x47 Posted July 22, 2016 Posted July 22, 2016 Start to make things on your own and don't steal from others one
EstrategiaGTA Posted July 22, 2016 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)
Turbesz Posted July 22, 2016 Author 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
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