X-SHADOW Posted March 28, 2013 Share Posted March 28, 2013 Hello iam want ask about i have Made an Announcments Bar but it's for 1 Msg how to Make table with messegs and timer to show all messegs for example #1 -- 'Welcome' -- after 20 sec .. change to #2 'Enjoy our server' etc ... Can someone Show Me an example ? Link to comment
DNL291 Posted March 28, 2013 Share Posted March 28, 2013 local messages = { "Welcome", "Enjoy our server", } addEventHandler("onClientResourceStart", resourceRoot, function() outputChatBox(messages[1], 255, 255, 255) setTimer( function() outputChatBox(messages[2], 255, 255, 255) end, 20000, 1 ) end ) You can do something more advanced, if you want more messages. Link to comment
X-SHADOW Posted March 28, 2013 Author Share Posted March 28, 2013 No not outputChatBox , i have an DxBar it's show messegs not output in Main Chat , Link to comment
DNL291 Posted March 28, 2013 Share Posted March 28, 2013 Just change "outputChatBox" to show in DxBar... Link to comment
Moderators IIYAMA Posted March 28, 2013 Moderators Share Posted March 28, 2013 addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientRender",root,welcomeMessages) end ) local messages = { "Welcome", "Enjoy our server" } local screenWidth, screenHeight = guiGetScreenSize ( ) local frame = 0 local msgCount = 1 local msgLimit = #messages function welcomeMessages() if msgCount > msgLimit then msgCount=1 -- if you want to stop the messages when they reached the last one. --removeEventHandler("onClientRender",root,welcomeMessages) --frame, screenWidth, screenHeight, messages, msgCount, msgLimit = nil,nil,nil,nil,nil,nil -- unload information. end frame = frame+1 dxDrawText (messages[msgCount],screenWidth/2, screenHeight/2) if frame > 1000 then frame = 0 msgCount = msgCount+1 end end no laggy timers needed and not tested.. 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