Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --se quiseres podes mudar o admin, caso é nil, pode ser selecionado usando !nickname
- admin = ""
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- objectid = 17
- power = 50
- admined = false
- moving = false
- if admin == "" then
- ui.addTextArea(1, "comando ! para selecionar admin (primeira letra é maiúscula)", nil, 300, 20, 0, 0, 0x324650, 0x324650, 1, true)
- else
- admined = true
- system.bindMouse(admin, true)
- ui.addTextArea(1, " <a href='event:ambient'>editar ambiente</a>", admin, 0, 380, 800, 0, 0x123450, 0x324650, 1, true)
- end
- for i, v in pairs(tfm.get.room.playerList) do
- system.disableChatCommandDisplay("set " .. i, true)
- end
- function eventNewPlayer(j)
- system.disableChatCommandDisplay("set " .. j, true)
- end
- function eventLoop()
- if admined then
- tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, 5, 0, 0, 0, nil)
- tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, -5, 0, 0, 0, nil)
- tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, 0, 5, 0, 0, nil)
- tfm.exec.displayParticle(24, tfm.get.room.playerList[admin].x, tfm.get.room.playerList[admin].y, 0, -5, 0, 0, nil)
- end
- end
- function eventChatCommand(jogador, comando)
- if admined == true then
- if jogador == admin then
- if string.sub(comando, 1, 3) == "set" then
- subject = string.sub(comando, 5)
- ui.addTextArea(1, "", jogador, 0, 20, 500, 320, 0xCFCFCF, 0x324650, 1, true)
- ui.addTextArea(2, "<a href='event:queijo'>Dar queijo</a>", jogador, 0, 20, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(3, "<a href='event:meep'>Dar meep</a>", jogador, 0, 50, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(4, "<a href='event:kill'>Morte</a>", jogador, 0, 80, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(5, "<a href='event:move'>mexer com ele</a>", jogador, 0, 110, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(6, "<a href='event:respawn'>renascer ele</a>", jogador, 0, 140, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(7, "<a href='event:change color'>mudar a cor do nick</a>", jogador, 0, 170, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(8, "<a href='event:score'>muda o score</a>", jogador, 0, 200, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(9, "<a href='event:shaman'>colocar shaman (permamente!)</a>", jogador, 0, 230, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(10, "<a href='event:vamp'>colocar como vampiro (meep desaparecerá)</a>", jogador, 0, 260, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(11, "<a href='event:close'>fechar</a>", jogador, 0, 350, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(12, "<a href='event:fly'>dar fly</a>", jogador, 0, 290, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(13, "<a href='event:ffa'>Dar FFA</a>", jogador, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(14, "para " .. subject, jogador, 0, 380, 00, 0, 0x324650, 0x324650, 1, true)
- end
- end
- else
- admin = comando
- admined = true
- print(comando .. " subiu a admin, pedido por " .. jogador)
- ui.removeTextArea(1, nil)
- system.bindMouse(admin, true)
- ui.addTextArea(1, " <a href='event:ambient'>editar ambiente</a>", admin, 0, 380, 800, 0, 0x123450, 0x324650, 1, true)
- end
- end
- function eventTextAreaCallback(id, player, callback)
- if callback == "queijo" then
- tfm.exec.giveCheese(subject)
- end
- if callback == "meep" then
- tfm.exec.giveMeep(subject)
- end
- if callback == "kill" then
- tfm.exec.killPlayer(subject)
- end
- if callback == "move" then
- moving = true
- end
- if callback == "respawn" then
- tfm.exec.respawnPlayer(subject)
- end
- if callback == "change color" then
- ui.showColorPicker(1, admin, 0, "muda de cor")
- end
- if callback == "score" then
- ui.addPopup(1, 2, "quanto de score deve ser adicionado?", admin, 200, 200,300, true)
- end
- if callback == "shaman" then
- tfm.exec.setShaman(subject)
- end
- if callback == "vamp" then
- tfm.exec.setVampirePlayer(subject)
- end
- if callback == "change" then
- ui.addPopup(3, 2, "Mapa (um input incorreto pode levar ao crash!)", admin, 200, 200,300, true)
- end
- if callback =="time" then
- ui.addPopup(4, 2, "tempo (um input incorreto pode levar ao crash!)", admin, 200, 200,300, true)
- end
- if callback == "snow" then
- ui.addPopup(5, 2, "quanto tempo (um input incorreto pode levar ao crash!)", admin, 200, 200,300, true)
- end
- if callback == "setname" then
- ui.addPopup(6, 2, "nome do mapa", admin, 200, 200,300, true)
- end
- if callback == "ffa" then
- system.bindKeyboard(subject, 77, false, true)
- ui.removeTextArea(13, nil)
- ui.addTextArea(13, "<a href='event:dffa'>Tirar FFA</a>", admin, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
- end
- if callback == "dffa" then
- system.bindKeyboard(subject, 77, false, false)
- ui.removeTextArea(13, nil)
- ui.addTextArea(13, "<a href='event:ffa'>Dar FFA</a>", admin, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
- end
- if callback == "setobject" then
- ui.addPopup(7, 2, "Id do objeto a ser atirado", admin, 200, 200,300, true)
- end
- if callback == "setvel" then
- ui.addPopup(8, 2, "Velocidade a ser atirada", admin, 200, 200,300, true)
- end
- if callback == "ambient" then
- ui.addTextArea(1, "", player, 0, 20, 500, 300, 0xCFCFCF, 0x324650, 1, true)
- ui.addTextArea(2, "<a href='event:change'>mudar o mapa</a>", player, 0, 20, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(3, "<a href='event:time'>mudar o tempo do mapa</a>", player, 0, 50, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(4, "<a href='event:snow'>fazer nevar</a>", player, 0, 80, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(5, "<a href='event:setname'>mudar o nome do mapa</a>", player, 0, 110, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(6, "<a href='event:setobject'>Mudar o objeto atirado, em caso de FFA</a>", player, 0, 140, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(7, "<a href='event:setvel'>Mudar o poder do objeto, em caso de FFA</a>", player, 0, 170, 500, 0, 0x324650, 0x324650, 1, true)
- ui.addTextArea(11, "<a href='event:close'>fechar</a>", player, 0, 320, 500, 0, 0x324650, 0x324650, 1, true)
- end
- if callback == "close" then
- for i=1,14 do
- ui.removeTextArea(i, admin)
- end
- ui.addTextArea(1, " <a href='event:ambient'>editar ambiente</a>", admin, 0, 380, 800, 0, 0x123450, 0x324650, 1, true)
- end
- if callback == "dfly" then
- system.bindKeyboard(subject, 32, false, false)
- ui.removeTextArea(12, nil)
- ui.addTextArea(12, "<a href='event:fly'>dar fly</a>", admin, 0, 290, 500, 0, 0x324650, 0x324650, 1, true)
- end
- if callback == "fly" then
- system.bindKeyboard(subject, 32, false, true)
- ui.removeTextArea(12, nil)
- ui.addTextArea(12, "<a href='event:dfly'>tirar fly</a>", admin, 0, 290, 500, 0, 0x324650, 0x324650, 1, true)
- end
- end
- function eventColorPicked(id, nill, cor)
- if cor == -1 then
- else
- tfm.exec.setNameColor(subject, cor)
- end
- end
- function eventPopupAnswer(id, jogador, resposta)
- if id == 1 then
- answer = resposta
- ui.addPopup(2, 1, "alterar (ou adicionar)?", admin, 200, 200, 300, true)
- end
- if id == 2 then
- tfm.exec.setPlayerScore(subject, answer, resposta)
- end
- if id == 3 then
- tfm.exec.newGame(resposta, nil)
- end
- if id == 4 then
- tfm.exec.setGameTime(resposta, true)
- end
- if id == 5 then
- tfm.exec.snow(resposta, 10)
- end
- if id == 6 then
- ui.setMapName(resposta)
- end
- if id == 7 then
- objectid = resposta
- end
- if id == 8 then
- power = resposta
- end
- end
- function eventMouse(j, x, y)
- if moving then
- tfm.exec.movePlayer(subject, x, y, false, 0, 0, true)
- moving = false
- end
- end
- function eventKeyboard(j, id, p, x, y)
- if id == 32 then
- tfm.exec.movePlayer(j, 0, 0, true, 0, -50, true)
- end
- if id == 77 then
- if tfm.get.room.playerList[j].isFacingRight then
- tfm.exec.addShamanObject(objectid,x+20,y-10,90,power,0)
- else
- tfm.exec.addShamanObject(objectid,x-20,y-10,-90,-power,0)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement