Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function eventChatCommand(p,cm)
- if cm == [[mort]] then
- tfm.exec.killPlayer(p)
- end
- end
- red={}
- blue={}
- function makeTeams()
- local playerList={}
- for name,player in pairs(tfm.get.room.playerList) do
- table.insert(playerList,name)
- end
- for i=1,#playerList,1 do
- local index=math.random(#playerList)
- local name=playerList[index]
- if i%2==0 then
- table.insert(red,name)
- else
- table.insert(blue,name)
- end
- table.remove(playerList,index)
- end
- end
- makeTeams()
- ranking={};
- function estaNaTabela(player)
- for i = #ranking,1,-1 do
- if ranking == player then
- return true;
- end
- end
- return false;
- end
- function verRanking(player)
- for i = #ranking,1,-1 do
- table.remove(ranking,i)
- end
- for i = 0,3 do
- local score = -1;
- local pl = nil;
- for p,v in pairs(tfm.get.room.playerList) do
- if v.score > score and not estaNaTabela(p) then
- score=v.score;
- pl=p;
- end
- end
- table.insert(ranking,pl)
- end
- for i = #ranking,1,-1 do
- print(ranking)
- end
- end
- verRanking()
- tfm.exec.disableAutoNewGame(true)
- ui.addTextArea(3,"<p align='center'><a href='event:Ajuda'>Ajuda</a></p>",NIL,650,20,145,20,1,1,0.5,true)
- -- Mapas
- mapas={"@4953687","@5032745","@1979131","@4843601"}
- -- Nova rounda
- function nextRound()
- tfm.exec.newGame(mapas[math.random(#mapas)])
- end
- -- Novo jogo
- function eventNewGame()
- vivo=0
- for name,player in pairs(tfm.get.room.playerList) do
- vivo=vivo+1
- end
- tfm.exec.setUIMapName("RaciRun" )
- for i in pairs(tfm.get.room.playerList) do
- end
- end
- -- Jogador morre
- function eventPlayerDied(name)
- vivo=vivo-1
- end
- -- Jogador ganha
- function eventPlayerWon(name)
- vivo=vivo-1
- end
- -- Nova ronda
- nextRound();
- --CallBack
- function eventTextAreaCallback(id, player, link)
- if link == "Ajuda" then
- ui.addTextArea(1,"<p align='center'><br><br><a href='event:fechar'>(fechar)</a></br><br>Bem vindo ao RaciRun!!! Corra Para Vencer e Ser O Idulo dos Seus amigos e uma Simples Corrida <R>Correr Caso queira Morrer utilize /mort</br</p>",player,250,100,400,200,1,1,0.9,true)
- end
- if link == "Ajuda" then
- if id == 1 then
- ui.removeTextArea(1,player)
- end
- end
- end
- function eventLoop(tempoPassado, tempoFaltando)
- if vivo == 0 or tempoFaltando < 1000 then
- nextRound();
- end
- end
- nextRound();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement