Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- info = {}
- ads = {[[<bv>Evento: "WallJumper"<br><j>Dia: 21/06/2015 - 16:40<br>Usuários interessados em participar comparecer no cafofo na data e horário!<br><br><v>Prêmio: Itens do Iventário!]],[[<BV>Evento WallJumper<br><j>Dia: 21/06/2015 - 16:40<br><v>Premio: Intens do Iventário<br><br><r>By: Tectoon]]}
- function eventAds(p)
- if info[p].ads == true then
- ui.addTextArea(0, [[]], p, -1500, -1500, 3000, 3000, 6976661, 6976661, 1.1, true);
- ui.addTextArea(1, [[<font face='Comic Sans MS' size='30'><p align='center'><br><b><r>Aviso!</ch></font><br><font face='Comic Sans MS' size='25'><j>]]..info[p].text..[[</p><br><font size="10"><j><ESCREVA AQUI(POUCA COISA)</j></font>]], p, 5, 5, 790, 590, 768, 768, 0.3, true);
- ui.addTextArea(2, [[<font face='Comic Sans MS' size="15">Você poderá jogar em ]]..info[p].count..[[ </font>]], p, 625, 320, 300, nil, 768, 768, 0.3, true);
- ui.addTextArea(3, [[]], p, 805, 5, 3000, 690, 6976661, 6976661, 1.1, true);
- end
- end
- function eventAdsExit(p)
- if info[p].ads == true then
- ui.addTextArea(2, [[<font face='Comic Sans MS' size="15"><a href='event:close'>Jogar ! » </a></font>]], p, 700, 320, 300, nil, 768, 768, 0.3, true);
- ui.addTextArea(3, [[]], p, 805, 5, 3000, 690, 6976661, 6976661, 1.1, true);
- end
- end
- function eventNewPlayer(p)
- if not info[p] then
- local data = {
- ["ads"] = true;
- ["time"] = os.time();
- ["count"] = 5;
- ["text"] = ads[math.random(#ads)];
- }
- info[p] = data
- elseif info[p] then
- info[p].text = ads[math.random(#ads)]
- info[p].count = 5
- info[p].time = os.time()
- end
- end
- for p in pairs(tfm.get.room.playerList) do
- eventNewPlayer(p)
- end
- function eventLoop()
- for p in pairs(tfm.get.room.playerList) do
- if info[p].time < os.time()-1000 and info[p].count > 0 and not info[p].ads == false then
- info[p].time = os.time()
- info[p].count = info[p].count-1
- eventAds(p)
- elseif info[p].count == 0 and not info[p].ads == false then
- eventAdsExit(p)
- end
- end
- end
- function eventPlayerLeft(p)
- if info[p].ads == false then
- info[p].ads = true
- end
- end
- function eventTextAreaCallback(t,p,c)
- if c == [[close]] then
- info[p].ads = false
- for i = 0,4 do
- ui.removeTextArea(i,p)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment