LucasBaker Posted June 1, 2013 Share Posted June 1, 2013 I used / debug script in script and appeared errors only this much that I still do not understand the errors could someone help me? image http://img191.imageshack.us/img191/4044/dasddt.png CODE: local messagesList = { "Visite: SBGames.com.br", "X sobre um carro para grudar.", "Carregando...", "Desejamos a todos um Bom Jogo.", } local currentMessage = 0 -- ******************** -- * Event handlers * -- ******************** addEventHandler("onClientPreRender", getRootElement(), function() local screenWidth, screenHeight = guiGetScreenSize() -- Draw the news sticker. dxDrawRectangle(screenWidth - 204, 4, 200, 20, tocolor(0, 0, 0, 192), false) -- Draw all strings. dxDrawText(messagesList[currentMessage + 1], screenWidth - 202, 6, screenWidth - 6, 16, tocolor(255, 0, 0, 255), 1, "default-bold", "center", "top", false, false, false) end ) function updateMessage() if (currentMessage == 4) then currentMessage = 0 else currentMessage = currentMessage + 1 end end setTimer(updateMessage, 5000, 0) Link to comment
Castillo Posted June 1, 2013 Share Posted June 1, 2013 local messagesList = { "Visite: SBGames.com.br", "X sobre um carro para grudar.", "Carregando...", "Desejamos a todos um Bom Jogo.", } local currentMessage = 1 -- ******************** -- * Event handlers * -- ******************** addEventHandler ( "onClientPreRender", getRootElement(), function ( ) local screenWidth, screenHeight = guiGetScreenSize ( ) -- Draw the news sticker. dxDrawRectangle ( screenWidth - 204, 4, 200, 20, tocolor(0, 0, 0, 192), false ) -- Draw all strings. dxDrawText ( messagesList [ currentMessage ], screenWidth - 202, 6, screenWidth - 6, 16, tocolor(255, 0, 0, 255), 1, "default-bold", "center", "top", false, false, false ) end ) function updateMessage ( ) if ( currentMessage >= #messagesList ) then currentMessage = 1 else currentMessage = ( currentMessage + 1 ) end end setTimer ( updateMessage, 5000, 0 ) Try that. Link to comment
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