Jump to content

[HELP ME] How to make this dxDrawText?


Turbesz

Recommended Posts

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
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
Start to make things on your own and don't steal from others one :P

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
Start to make things on your own and don't steal from others one :P

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 :mrgreen:

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...