xXMADEXx Posted March 16, 2013 Posted March 16, 2013 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 ) The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted March 16, 2013 Posted March 16, 2013 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xXMADEXx Posted March 16, 2013 Author Posted March 16, 2013 Text isn't coming out. The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted March 16, 2013 Posted March 16, 2013 Oh yeah, fixed it, copy it again. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xXMADEXx Posted March 16, 2013 Author Posted March 16, 2013 Castillo, my hero <3 The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted March 16, 2013 Posted March 16, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Anderl Posted March 16, 2013 Posted March 16, 2013 Use local variables whenever possible. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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