Madruga Posted February 24, 2019 Posted February 24, 2019 Opa, Sou iniciante em programação e to com uma info msg em dx, cod: server-side function addNotification(player, text, type) if (player and text and type) then triggerClientEvent(player, 'addNotification1', player, text, type); end end function msg1() triggerClientEvent(root, 'addNotification1', root, "NÃO É TOLERADO ANTI RP NO SERVIDOR, EVITE SER BANIDO!", "warning"); end setTimer(msg1,300000,0) function msg2() triggerClientEvent(root, 'addNotification', root, "VEJA INFORMAÇÕES SOBRE O SERVIDOR NO F4!", "warning"); end setTimer(msg2,200000,0) Ta funcionando perfeitamente, oque eu quero é que de tempo em tempo mande uma mensagem, por exemplo, a msg1 é executada e depois de 5 minutos a msg2 é executada, e após 5 minutos denovo a msg1 é executada novamente, deu pra entender? de 5 em 5 uma msg é executada e queria ter a liberdade de adicionar uma possível msg3 funcinando da mesma forma, msg1,msg2 ai vem a msg3 e após retorna a msg1.
[M]ister Posted February 24, 2019 Posted February 24, 2019 local atualmsg = 1 local msgs = { "NÃO É TOLERADO ANTI RP NO SERVIDOR, EVITE SER BANIDO!", "VEJA INFORMAÇÕES SOBRE O SERVIDOR NO F4!", "msg3" } triggerClientEvent(root, 'addNotification', root, msgs[atualmsg], "warning") setTimer( function() if atualmsg == #msgs then atualmsg = 1 else atualmsg = atualmsg + 1 end triggerClientEvent(root, 'addNotification', root, msgs[atualmsg], "warning") end ,300000,0)
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