Jump to content

help on dxDrawText


xXMADEXx

Recommended Posts

How can i make the script below, so that when the box shows, it will stay on the message, and not generate through all of them?

messages = 
{ 
{"Enjoy Your Stay "}, 
{"Website:\n[url=http://www.rog-mta.tk]http://www.rog-mta.tk[/url]"}, 
{"Have Fun, Or Be Punished!"} 
} 
  
  
function genorateMessage() 
    return unpack(messages[math.random(#messages)]) 
end 
  
function dxRectangle() 
    dxDrawRectangle(998, 285, 275, 487, tocolor(0, 0, 0, 150), true) 
    dxDrawLine(998, 286, 998, 774, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawLine(996, 772, 1270, 772, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawLine(996, 285, 1270, 285, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawLine(1270, 284, 1270, 772, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawText("INFORMATION", 1008, 296, 1262, 328, tocolor(255, 255, 255, 255), 2, "default-bold", "center", "top", false, false, true, false, false) 
    dxDrawLine(996, 348, 1270, 348, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawText(genorateMessage(), 1018, 352, 1249, 753, tocolor(255, 255, 255, 255), 1.5, "default", "left", "top", false, false, true, false, false) 
end 
  
setTimer( 
    function () 
        addEventHandler("onClientRender",root,dxRectangle) 
        setTimer( 
            function () 
                removeEventHandler("onClientRender",root,dxRectangle) 
            end, 10000, 1 
        ) 
    end, 15000, 0 
) 

Link to comment
messages = 
{ 
{"Enjoy Your Stay "}, 
{"Website:\n[url=http://www.rog-mta.tk]http://www.rog-mta.tk[/url]"}, 
{"Have Fun, Or Be Punished!"} 
} 
currentMessage = "" 
  
function genorateMessage() 
    return unpack(messages[math.random(#messages)]) 
end 
  
function dxRectangle() 
    dxDrawRectangle(998, 285, 275, 487, tocolor(0, 0, 0, 150), true) 
    dxDrawLine(998, 286, 998, 774, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawLine(996, 772, 1270, 772, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawLine(996, 285, 1270, 285, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawLine(1270, 284, 1270, 772, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawText("INFORMATION", 1008, 296, 1262, 328, tocolor(255, 255, 255, 255), 2, "default-bold", "center", "top", false, false, true, false, false) 
    dxDrawLine(996, 348, 1270, 348, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawText(currentMessage, 1018, 352, 1249, 753, tocolor(255, 255, 255, 255), 1.5, "default", "left", "top", false, false, true, false, false) 
end 
  
setTimer( 
    function () 
        addEventHandler("onClientRender",root,dxRectangle) 
        setTimer( 
            function () 
                removeEventHandler("onClientRender",root,dxRectangle) 
            end, 10000, 1 
        ) 
        currentMessage  = genorateMessage() 
    end, 15000, 0 
) 

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