Tectoon

[TFM] Divulgação de Projetos

Jun 21st, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.21 KB | None | 0 0
  1. info = {}
  2. 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]]}
  3.  
  4. function eventAds(p)
  5.     if info[p].ads == true then
  6.         ui.addTextArea(0, [[]], p, -1500, -1500, 3000, 3000, 6976661, 6976661, 1.1, true);
  7.         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);
  8.         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);
  9.         ui.addTextArea(3, [[]], p, 805, 5, 3000, 690, 6976661, 6976661, 1.1, true);
  10.     end
  11. end
  12.  
  13. function eventAdsExit(p)
  14.     if info[p].ads == true then
  15.         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);
  16.         ui.addTextArea(3, [[]], p, 805, 5, 3000, 690, 6976661, 6976661, 1.1, true);
  17.     end
  18. end
  19.  
  20. function eventNewPlayer(p)
  21.     if not info[p] then
  22.         local data = {
  23.             ["ads"] = true;
  24.             ["time"] = os.time();
  25.             ["count"] = 5;
  26.             ["text"] = ads[math.random(#ads)];
  27.         }
  28.         info[p] = data
  29.     elseif info[p] then
  30.         info[p].text = ads[math.random(#ads)]
  31.         info[p].count = 5
  32.         info[p].time = os.time()
  33.     end
  34. end
  35.  
  36. for p in pairs(tfm.get.room.playerList) do
  37.     eventNewPlayer(p)
  38. end
  39.  
  40. function eventLoop()
  41.     for p in pairs(tfm.get.room.playerList) do
  42.         if info[p].time < os.time()-1000 and info[p].count > 0 and not info[p].ads == false then
  43.             info[p].time = os.time()
  44.             info[p].count = info[p].count-1
  45.             eventAds(p)
  46.         elseif info[p].count == 0 and not info[p].ads == false then
  47.             eventAdsExit(p)
  48.         end
  49.     end
  50. end
  51.  
  52. function eventPlayerLeft(p)
  53.     if info[p].ads == false then
  54.         info[p].ads = true
  55.     end
  56. end
  57.  
  58. function eventTextAreaCallback(t,p,c)
  59.     if c == [[close]] then
  60.         info[p].ads = false
  61.             for i = 0,4 do
  62.                 ui.removeTextArea(i,p)
  63.             end
  64.     end
  65. end
Advertisement
Add Comment
Please, Sign In to add comment