Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = "Pvsto"
- teamPlayers = {
- {"Pvsto", "", "", "", ""};
- {"", "", "", "", "", ""};
- }
- goalScore = 15
- maps = {247329,250610,2118599,445133,149853,212903,220737,397296,2617003,629731,329627,221767,422655,417816,164931,245152,371072,2458243,214788,274963,2439335,269534,8679,321268,398041,5591416,5650343,5650250,161730,4273207,4091580,5650303,5172709,5650469,214660,3579335,4003729,508451,314205,156510,5545443,606723,3946626,332467,1665516,1614563,3679884,414899,1531388,905496,3834905,3821104,1851411,3816991,2331474,313245,266854,193588,2141379,3738767,232791,285752,278506,406266,1976857,301315,180469,3693822,280896,403698,259604,418022,323366,594883,477603,437860,590641,3688419,3682405,645288,419374,664949,704015,398942,195720,314159,613985,3683383,3683201,3680223,3680221,363625,1693705,319524,3667358,1718723,1490438,3630433,3620542,3617674,3556489,3548406,3548376,3408247,2953315,2883986,2683170,2645615,2536577,2453022,2372538,2287914,2286056,2223685,2150335,2150335,2101747,2018511,2007205,1975684,1964752,1964700,1956555,1923785,1862800,1716949,1674534,1658171,1659639,1657360,1657021,1654105,1651658,1643157,1634741,1632706,1622737,1619934,1618110,1613550,1612796,1612436,1608638,6212895,1602654,1601492,1586439,1588884,1573997,1567620,1542618,1539791,1513407,1509474,1503393,1487161,1450554,1425101,1394120,1393405,1373000,1371239,1368222,1359797,1358446,1352534,1346440,1321664,1321417,1281981,1255130,1222899,1214182,1195842,1143815,1132357,1058681,979179,829657,813156,798953,749102,737841,627609,624721,608459,616373,594049,606719,586688,580031,564033,558790,551126,545493,536235,528428,511275,508106,501711,496945,496091,483924,472665,472379,447556,445133,444490,441047,438154,436447,436107,431373,430145,429822,428517,427300,425806,424795,422361,421302,420956,420806,418658,418600,416142,412316,410813,412211,410565,410532,410230,407457,407455,407230,407165,406982,406881,406486,405295,403910,401995,401945,401778,397938,397812,397296,396861,396645,391625,387270,387180,386046,385295,386029,379745,378826,379866,364998,359055,352885,352710,350251,344952,340069,339896,339643,337774,323600,319841,317754,309029,308711,308435,306213,292348,278916,277784,275514,270819,1017676,160762,2089069,234039,267187,263163,262144,330590,403698,396105,6538564,396105,419735,6547536,355658,6607378,191716,292348,6456247,5326916,6077025,356722,2564883,1450554,494706,254291,1503393,6467947,6263285,2953315,6114281,412752,4038817,5461992,319841,359901,191716,452016,1450554,397296,250610,499684,5848412,238791,2283,232274,1716693,330590,459349,6583596,455167,6460747,251459,244888,5755208,240973,235501,235034,234039,233398,232274,230510,216735,216439,216505,214037,212542,211565,198715,193936,191716,186604,180274,176263,178657,146801,145020,3154,2283,5382692,5249500,4412890,5163891,789128,2245005,2030343,5712914,372401,5087373,4953687,2369254,4853690,226069,422509,5436200,732880,4038817,400866,3730656,3985806,355658,5175727,5699298,5588646,3921436,3639993,3984750,508796,1985019,4734427,1703617,289068,197219,333666,6077025,5710586,322321,331572,4741601,}
- ------------------------------------------------------------
- teamColor = {0xCC0000, 0x0033FF}
- teamScore = {0,0}
- gameStarted = nil
- gameFinished = nil
- currentMap = nil
- playersAlive = nil
- playersInRoom = 0
- players = {}
- team = {}
- first = nil
- teamList = {"",""}
- for i=1,2 do
- for _,name in pairs(teamPlayers[i]) do
- team[name] = i
- teamList[i] = teamList[i] .. name .. "\n"
- end
- end
- function main()
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- tfm.exec.newGame(0)
- local x = {110,690}
- for name,t in pairs(team) do
- tfm.exec.movePlayer(name, x[t], 350)
- end
- tfm.exec.movePlayer(admin, 400, 350)
- ui.addTextArea(1, "<font size='16'>Equipo 1</font>\n\n"..teamList[1], nil, 30, 54, 160, 320, 0x4a4d60, 0x3a3d4b, 0.8, true)
- ui.addTextArea(2, "<font size='16'>Equipo 2</font>\n\n"..teamList[2], nil, 610, 54, 160, 320, 0x4a4d60, 0x3a3d4b, 0.8, true)
- ui.addTextArea(3, "<p align='center'><font size='16'><a href='event:start'> Empezar </a></font></p>", admin, 320, 180, 160, 32, 0x4a4d60, 0x3a3d4b, 1, true)
- end
- function startGame()
- local newMap
- repeat
- newMap = math.random(#maps)
- until newMap ~= currentMap
- currentMap = newMap
- tfm.exec.newGame(maps[newMap])
- end
- function endGame()
- startGame()
- end
- function eventNewGame()
- playersAlive = playersInRoom
- first = false
- for name,t in pairs(team) do
- tfm.exec.setNameColor(name, teamColor[t])
- end
- tfm.exec.setGameTime(60)
- end
- function eventNewPlayer(name)
- if team[name] then
- playersInRoom = playersInRoom + 1
- end
- end
- function eventPlayerLeft(name)
- if team[name] then
- playersInRoom = playersInRoom - 1
- end
- end
- function eventPlayerDied(name)
- if not gameStarted then return end
- if team[name] then
- playersAlive = playersAlive - 1
- checkPlayers()
- end
- end
- function eventPlayerWon(name)
- if not gameStarted then return end
- if team[name] then
- if not first then
- first = true
- local t = team[name]
- teamScore[t] = teamScore[t] + 1
- updateScore()
- tfm.exec.setGameTime(5)
- if teamScore[t] == goalScore then
- gameStarted = false
- gameFinished = true
- local c = {"#F90505","#0045FF"}
- ui.addTextArea(5, "<p align='center'><font size='20' color='" .. c[t] .. "'>¡El equipo " .. t .. " ha ganado!</font></p>", nil, 0, 170, 800, 60, 0, 0, 0, true)
- end
- end
- playersAlive = playersAlive - 1
- checkPlayers()
- end
- end
- function checkPlayers()
- if playersAlive == 0 then
- endGame()
- end
- end
- function eventLoop(t, tr)
- if gameFinished then
- for i=1,8 do
- local x,y = math.random(0,800), math.random(0,400)
- for j=1,5 do
- tfm.exec.displayParticle(math.random(21,24), x, y, math.random(-5,5), 0, 0, math.random(10)/10, nil)
- end
- end
- end
- if not gameStarted then return end
- if tr <= 0 then
- endGame()
- end
- end
- function eventTextAreaCallback(id, name, cb)
- if id == 3 and not gameStarted then
- gameStarted = true
- for i=1,3 do
- ui.removeTextArea(i)
- end
- updateScore()
- startGame()
- end
- end
- function updateScore()
- local t = string.format("<p align='center'><font size='32'><font color='#F90505'>%02d</font> - <font color='#0045FF'>%02d</font></font></p>", teamScore[1], teamScore[2])
- ui.addTextArea(4, t, nil, 320, 20, 160, 43, 0x4a4d60, 0x3a3d4b, 0, true)
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement