Jump to content

I got a problem..


PandaTV

Recommended Posts

Posted

So, I want to create a timer to dxDrawText, but I really don't know how. I know it's easy, but what the fuck, really .I am mad.

function panda()

if not x then

local screenWidth, screenHeight = guiGetScreenSize()

function createText ( )

dxDrawText( "Panda is awesome.", 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 111, 155, 0, 255 ), 1, "bankgothic" )

setTimer(removeEventHandler, 2500, 1, "onClientRender", root, createText)

end

addEventHandler("onClientRender",root, createText)

Can anyone help me? the current setTimer doesn't work\remove the text.

Posted
local screenWidth, screenHeight = guiGetScreenSize ( ) 
  
function createText ( ) 
    dxDrawText ( "Panda is awesome.", 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 111, 155, 0, 255 ), 1, "bankgothic" ) 
end 
addEventHandler ( "onClientRender",root, createText ) 
setTimer ( 
    function ( ) 
        removeEventHandler ( "onClientRender", root, createText ) 
    end 
    ,2500, 1, 
) 

Is that what you wanted?

Posted

Thank you very much!

One more thing, can you show me an example of making the dxDrawText in that way: first letter of word is white and the rest of text is orange. (color-coded)

Guest Guest4401
Posted

Syntax:

290bdad58c57b6689487dcf44e164fa6.png

According to syntax the 2nd last argument can allow you to make your text colorcoded (You can add html color codes in between like #ff0000)

Example:

dxDrawText ( "#ffffffK#ff8800arthik #ffffffis awesome.", 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 111, 155, 0, 255 ), 1, "bankgothic", "left", "top", false, false, false, true, false ) 

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...