Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Em SeuNome coloque o seu nickname
- -- Em Sorteio de Teste coloque o nome do sorteio
- adm = "SeuNome"
- nome = "Sorteio de Teste"
- mapa=[[<C><P Ca="" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="800" X="401" N="" Y="386" T="0" H="50" /></S><D><DS Y="348" X="400" /></D><O /></Z></C>]]
- mapa1=[[<C><P/><Z><S><S L="800" H="50" X="401" N="" Y="386" T="0" P="0,0,0.3,0.2,0,0,0,0" /></S><D><P C="ac2d0c" Y="373" T="15" P="0,0" X="563" /><P C="ac2d0c" Y="373" T="15" X="707" P="0,0" /><P C="ac2d0c" Y="373" T="15" X="90" P="0,0" /><P C="ac2d0c" Y="373" T="15" P="0,0" X="233" /><P C="bd4adb" Y="361" T="130" X="463" P="0,0" /><P C="bd4adb" Y="361" T="130" P="0,0" X="337" /><DS Y="200" X="400" /></D><O /></Z></C>]]
- mapa2=[[<C><P D="x_evenements/x_fondHalloween.jpg,0,-250" Ca="" /><Z><S><S L="800" X="400" H="50" Y="386" T="10" P="0,0,0.3,0,0,0,0,0" /></S><D><DS Y="346" X="400" /><P P="0,0" C="470f0e" Y="365" T="15" X="87" /><P P="0,0" Y="166" T="43" X="129" /><P P="0,0" Y="361" T="48" X="215" /><P P="0,0" Y="361" T="44" X="767" /><P P="0,0" C="470f0e" Y="366" T="19" X="715" /><P P="0,0" Y="361" T="44" X="559" /><P P="0,0" C="470f0e" Y="366" T="19" X="614" /><P P="0,0" C="470f0e" Y="366" T="19" X="665" /><P P="0,0" Y="362" T="48" X="507" /></D><O /></Z></C>]]
- mapa3=[[<C><P D="x_evenements/x_fondNowel2013.jpg,0,0" /><Z><S><S L="800" H="50" X="400" Y="386" T="10" P="0,0,0.3,0,0,0,0,0" /></S><D><DS Y="346" X="400" /><P P="0,0" C="8a311b" Y="367" T="15" X="84" /><P P="0,0" C="8a311b" Y="367" T="15" X="711" /><P P="0,0" C="8a311b" Y="366" T="15" X="567" /><P P="0,0" C="8a311b" Y="365" T="15" X="227" /></D><O /></Z></C>]]
- participante = {}
- inicio = false
- fim=false
- qtd=0
- fast=0
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- function eventTextAreaCallback(id, p, cmd)
- tfm.exec.setNameColor(adm, 0xd60004)
- if cmd == "entrada" then
- ui.addTextArea(0, "<p align='center'>Participando", p, 210, 370, 380, 20, 1, 0x00ff00, 0.8,false)
- entrada(p, #participante + 1)
- elseif cmd == "map" then
- ui.addPopup(1, 2, "<p align='center'>Mudar Mapa</p><p align='center'><font size='7'>Introduza o id do mapa</p><p align='left'><font color='#FFFFF0' size='9'>[0] Simples</p><p align='left'><font color='#FFFFF0' size='9'>[1] Normal</p><p align='left'><font color='#FFFFF0' size='9'>[2] Halloween</p><p align='left'><font color='#FFFFF0' size='9'>[3] Natal</p>", p, 300, 130, 200, false)
- elseif cmd == "credits" then
- ui.addPopup(-2, 0, "<font color='#EDD200' size='15'><p align='center'><s>Creditos</p></font> <p align='left'><s>Programado por: Ricfonseca & Ricat1998</p> <p align='left'><s>Desenvolvido por: Universe Team</p> <p align='left'><s>Versão em execução: 1.1.0</p> <p align='left'><s> </p> <p align='left'><s>Universe Team & Transformice Universe</p> <p align='left'><s>© 05/11/2016 Versão em Português</p>", p, 270, 120, 250, false)
- elseif cmd == "ajuda" then
- ui.addPopup(-5, 0, "<font color='#EDD200' size='15'><p align='center'><s>Ajuda & FAQ</p></font> <p align='left'><s>1) Eu posso sair do cafofo?</p> <p align='left'><s>- Sim, você pode sair do cafofo que continuará registado no sorteio.</p> <p align='left'><s>2) Como participo no sorteio?</p> <p align='left'><s>- Para participar no sorteio clique em participar na barra cá em baixo.</p> <p align='left'><s>3) Quando vai começar o sorteio?</p> <p align='left'><s>- O sorteio começa quando o admistrador assim o entender.</p>", p, 168, 120, 460, false)
- elseif cmd == "inicio" then
- ui.addPopup(0, 2, "<p align='center'>Quantidade de vencedores", p, 300, 200, 200, false)
- elseif cmd == "novo" then
- novo()
- end
- end
- function eventNewPlayer(p)
- tfm.exec.respawnPlayer(p)
- tfm.exec.setNameColor(adm, 0xd60004)
- ui.addTextArea(0, "<p align='center'><a href='event:entrada'>Clique para participar no sorteio!", p, 210, 370, 380, 20, 1, 0xffff00, 0.8, false)
- ui.addTextArea(-2, "<p align='center'><a href='event:credits'>Creditos", p, 21, 370, 60, 20, 1, 0x0000ff, 0.8, false)
- ui.addTextArea(-5, "<p align='center'><a href='event:ajuda'>Ajuda", p, 110, 370, 60, 20, 1, 0x0000ff, 0.8, false)
- ui.addTextArea(-3, "<p align='center'><font size='30'>"..nome, p, 5, 40, 790, 40, 1, 1, 0.8, false)
- end
- function eventPopupAnswer(id, p, cmd)
- if id == 1 then
- if tonumber(cmd, 10) then
- if tonumber(cmd, 10) == 0 then
- tfm.exec.newGame(mapa)
- end
- if tonumber(cmd, 10) == 1 then
- tfm.exec.newGame(mapa1)
- end
- if tonumber(cmd, 10) == 2 then
- tfm.exec.newGame(mapa2)
- end
- if tonumber(cmd, 10) == 3 then
- tfm.exec.newGame(mapa3)
- end
- tfm.exec.setUIMapName("Sala de Sorteios")
- end
- end
- if id == 0 then
- if tonumber(cmd, 10) then
- if tonumber(cmd, 10) >= 1 and tonumber(cmd, 10) <= #participante then
- ui.removeTextArea(0, nil)
- ui.removeTextArea(-1, nil)
- ui.removeTextArea(-6, nil)
- qtd = tonumber(cmd, 10)
- fast = math.random(5,15)
- inicio = true
- end
- end
- end
- end
- function participando(p)
- for i, v in pairs(participante) do
- if v == p then
- return true
- end
- end
- return false
- end
- function entrada(p, num)
- if not participando(p) then
- participante[num] = p
- ui.addTextArea(num, "<p align='center'>" .. p, nil, ((num-1)%8)*100+5, math.floor((num-1)/8)*30+100, 90, 20, 1, 1, 0.8, false)
- end
- end
- function novo()
- for i=1, #participante do
- ui.removeTextArea(i, nil)
- table.remove(participante, 1)
- end
- ui.addTextArea(0, "<p align='center'><a href='event:entrada'>Clique para participar no sorteio!", nil, 210, 370, 380, 20, 1, 0xffff00, 0.8, false)
- ui.addTextArea(-2, "<p align='center'><a href='event:credits'>Creditos", nil, 12, 370, 80, 20, 1, 0x0000ff, 0.8, false)
- ui.addTextArea(-5, "<p align='center'><a href='event:ajuda'>Ajuda", nil, 111, 370, 80, 20, 1, 0x0000ff, 0.8, false)
- ui.addTextArea(-1, "<p align='center'><a href='event:inicio'>Iniciar", adm, 707, 370, 80, 20, 1, 0xd60004, 0.8,false)
- ui.addTextArea(-6, "<p align='center'><a href='event:map'>Mapa", adm, 609, 370, 80, 20, 1, 0xd60004, 0.8,false)
- tfm.exec.removePhysicObject(0)
- fim = false
- end
- function sorteio(tipo)
- local lista = {}
- local sorteado = 0
- for i=1, #participante do
- lista[i] = i
- end
- local rand = 0
- for i, v in pairs(participante) do
- ui.addTextArea(i, "<p align='center'>" .. v, nil, ((i-1)%8)*100+5, math.floor((i-1)/8)*30+100, 90, 20, 1, 1, 0.8, false)
- end
- for i=1, qtd do
- sorteado = math.random(#lista)
- rand = lista[sorteado]
- table.remove(lista, sorteado)
- if tipo == "quase" then
- ui.addTextArea(rand, "<p align='center'><font color='#ffff00'>" .. participante[rand], nil, ((rand-1)%8)*100+5, math.floor((rand-1)/8)*30+100, 90, 20, 1, 0xffff00, 0.8, false)
- elseif tipo == "final" then
- ui.addTextArea(rand, "<p align='center'><font color='#00ff00'><b>" .. participante[rand], nil, ((rand-1)%8)*100+5, math.floor((rand-1)/8)*30+100, 90, 20, 1, 0x00ff00, 0.8, false)
- end
- end
- end
- function eventLoop()
- if inicio then
- if fast > 0 then
- sorteio("quase")
- fast = fast - 1
- else
- sorteio("final")
- inicio = false
- fim = true
- ui.addTextArea(-1, "<p align='center'><a href='event:novo'>Novo sorteio", adm, 650, 370, 100, 20, 1, 0xd60004, 0.8,false)
- end
- end
- if fim then
- tfm.exec.displayParticle(math.random(21,24), math.random(1,800), 20, math.random(-20,20)/100, math.random(10,1000)/100, 0, 0, nil)
- tfm.exec.displayParticle(math.random(21,24), math.random(1,800), 20, math.random(-20,20)/100, math.random(10,1000)/100, 0, 0, nil)
- tfm.exec.displayParticle(math.random(21,24), math.random(1,800), 20, math.random(-20,20)/100, math.random(10,1000)/100, 0, 0, nil)
- end
- end
- function eventPlayerDied(p)
- tfm.exec.respawnPlayer(p)
- end
- tfm.exec.newGame(mapa1)
- ui.addTextArea(0, "<p align='center'><a href='event:entrada'>Clique para participar no sorteio!", nil, 210, 370, 380, 20, 1, 0xffff00, 0.8, false)
- ui.addTextArea(-2, "<p align='center'><a href='event:credits'>Creditos", nil, 12, 370, 80, 20, 1, 0x0000ff, 0.8, false)
- ui.addTextArea(-5, "<p align='center'><a href='event:ajuda'>Ajuda", nil, 111, 370, 80, 20, 1, 0x0000ff, 0.8, false)
- ui.addTextArea(-1, "<p align='center'><a href='event:inicio'>Iniciar", adm, 707, 370, 80, 20, 1, 0xd60004, 0.8,false)
- ui.addTextArea(-6, "<p align='center'><a href='event:map'>Mapa", adm, 609, 370, 80, 20, 1, 0xd60004, 0.8,false)
- ui.addTextArea(-3, "<p align='center'><font size='30px'>"..nome, nil, 5, 40, 790, 40, 1, 1, 0.8, false)
- tfm.exec.setUIMapName("Sala de Sorteios")
Add Comment
Please, Sign In to add comment