Jump to content

[Help]Drawing text on screen


//_Dragon

Recommended Posts

It's possible to draw text on screen player ? like dxdraw3D

I want make it in my script :arrowdown:

time = {} 
    function Countdown (player, cmd) 
      if isTimer(time[player]) then return end 
        time[player] = setTimer(function() time[player] = nil end,30000,1) 
        local name = getPlayerName(player) 
        local r,g,b = getPlayerNametagColor (player) 
        local accountname = getAccountName (getPlayerAccount(player)) 
        outputChatBox ( "" .. name .. ": #FF9600 Starts the Countdown !", getRootElement(), r, g, b, true ) 
        outputChatBox ( "#FF0000 ===3===", getRootElement(), 255, 255, 255, true ) 
        triggerClientEvent("triggerclientforGridCountdown", getRootElement()) 
        setTimer ( Countdown5, 1000, 1 ) 
    end 
    function Countdown5 ( root ) 
        outputChatBox ( "#FF0000 ===2===", getRootElement(), 255, 255, 255, true ) 
        setTimer ( Countdown4, 1000, 1 ) 
    end 
    function Countdown4 ( root ) 
        outputChatBox ( "#FF0000 ===1===", getRootElement(), 255, 255, 255, true ) 
        setTimer ( Countdown3, 1000, 1 ) 
    end 
    function Countdown3 ( root ) 
        outputChatBox ( "#FF0000 Go Go Go!!!", getRootElement(), 255, 255, 255, true ) 
        setTimer ( Countdown2, 1000, 1 ) 
    end 
      
    addCommandHandler( "cd", Countdown ) 

Link to comment

I make this script , but it's showing Only ==3== other text no :?

+ debugscript : http://imgur.com/Q76Wago

function Countdown (player, cmd) 
        local name = getPlayerName(player) 
        local r,g,b = getPlayerNametagColor (player) 
        textDisplay = textCreateDisplay ( ) 
        local accountname = getAccountName (getPlayerAccount(player)) 
        textItem = textCreateTextItem ( "" .. name .. "", 0.5, 0.5, 2, 225, 0, 0, 255, 4, "center", "center", 50 ) 
        textItem = textCreateTextItem ("===3===", 0.5, 0.5, 2, 225, 0, 0, 255, 4, "center", "center", 50 ) 
        textDisplayAddText ( textDisplay, textItem ) 
        for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 
            textDisplayAddObserver ( textDisplay, thePlayer ) 
        setTimer ( 
            function ( ) 
                textDestroyTextItem ( textItem ) 
                textDestroyDisplay ( textDisplay ) 
            end 
            ,1000, 1 
        ) 
        triggerClientEvent("triggerclientforGridCountdown", getRootElement()) 
end 
        setTimer ( Countdown5, 1000, 1 ) 
    end 
    function Countdown5 ( root ) 
end 
        textItem = textCreateTextItem ("===2===", 0.5, 0.5, 2, 225, 0, 0, 255, 4, "center", "center", 50 ) 
        textDisplayAddText ( textDisplay, textItem ) 
        for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 
            textDisplayAddObserver ( textDisplay, thePlayer ) 
        setTimer ( 
            function ( ) 
                textDestroyTextItem ( textItem ) 
                textDestroyDisplay ( textDisplay ) 
            end 
            ,1000, 1 
        ) 
end 
    function Countdown4 ( root ) 
end 
       textItem = textCreateTextItem ("===1===", 0.5, 0.5, 2, 225, 0, 0, 255, 4, "center", "center", 50 ) 
        textDisplayAddText ( textDisplay, textItem ) 
        for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 
            textDisplayAddObserver ( textDisplay, thePlayer ) 
        setTimer ( 
            function ( ) 
                textDestroyTextItem ( textItem ) 
                textDestroyDisplay ( textDisplay ) 
            end 
            ,1000, 1 
        ) 
end 
    function Countdown3 ( root ) 
end  
        textItem = textCreateTextItem ("GO", 0.5, 0.5, 2, 225, 0, 0, 255, 4, "center", "center", 50 ) 
        textDisplayAddText ( textDisplay, textItem ) 
        for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do 
            textDisplayAddObserver ( textDisplay, thePlayer ) 
        setTimer ( 
            function ( ) 
                textDestroyTextItem ( textItem ) 
                textDestroyDisplay ( textDisplay ) 
            end 
            ,1000, 1 
        ) 
end 
     addCommandHandler( "cd", Countdown ) 
  
  
  
  

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