X-SHADOW Posted March 28, 2013 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 ? My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
DNL291 Posted March 28, 2013 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. Please do not PM me with scripting related question nor support, use the forums instead.
X-SHADOW Posted March 28, 2013 Author Posted March 28, 2013 No not outputChatBox , i have an DxBar it's show messegs not output in Main Chat , My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
DNL291 Posted March 28, 2013 Posted March 28, 2013 Just change "outputChatBox" to show in DxBar... Please do not PM me with scripting related question nor support, use the forums instead.
Moderators IIYAMA Posted March 28, 2013 Moderators 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.. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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