Advertisement
HackinMauro

Untitled

Mar 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.03 KB | None | 0 0
  1. commands = {"print", "changetime", "teach", "aport", "resetmap", "l"}
  2. for i,command in ipairs(commands) do system.
  3.     disableChatCommandDisplay(command,true)
  4. end
  5. local admins = {"Hackinnzkt#0000", "Roroneo", "Sebah#8993", "Twiisa#0000", "Juanfmlal#0000","Hackinzkt#0000"}
  6.  
  7. -- Load script
  8.  
  9. tfm.exec.setNameColor("Hackinnzkt",0xFCF903)
  10.  
  11. tfm.exec.setNameColor("Roroneo",0xD500FF)
  12. tfm.exec.setNameColor("Sebah",0xD500FF)
  13. tfm.exec.setNameColor("Twiisa",0xD500FF)
  14. tfm.exec.setNameColor("Juanfmlal",0xD500FF)
  15. tfm.exec.setUIMapName("MAPA POR RANGO")
  16. tfm.exec.disablePhysicalConsumables()
  17.  
  18. ui.addTextArea(1000, "<p align='center'><font size='12px' color='#FFFFFF'><a href='event:openOptions'>»</a>", nil, 3, 365,15, 25, 0x000000, 0xFF0804, 0.5,false)
  19.  
  20. tfm.exec.setGameTime(480) -- TIEMPO INICIAL
  21.  
  22. function eventNewPlayer(playerName)
  23. tfm.exec.setUIMapName("MAPA POR RANGO")
  24. ui.addTextArea(1000, "<p align='center'><font size='12px' color='#FFFFFF'><a href='event:openOptions'>»</a>", nil, 3, 365,15, 25, 0x000000, 0xFF0804, 0.5,false)
  25. tfm.exec.bindKeyboard(playerName,32,true,true)
  26. system.bindMouse(playerName)
  27. end
  28.  
  29.  
  30. local t=0
  31. function eventLoop(time,remaining)
  32. rm = remaining
  33. if remaining<=120000 then
  34. ui.addTextArea(1, "<p align='center'><font size='12px' color='#FF0804'>AVISO: QUEDAN 2 MINUTOS", nil, 5, 25,790, 18, 0x000000, 0xFF0804, 0.5,false)
  35. if remaining<=110000 then
  36. ui.removeTextArea(1, nil)
  37. if remaining<=0 then
  38. ui.addTextArea(2, "", nil, 5, 24,790, 400, 0x111111, 0x111111, 0.5, false)
  39. ui.addTextArea(0, "<p align='center'><font size='13px' color='#FFD800'><b>¡Se ha acabo el tiempo!</b> <font size='13px' color='#FFFFFF'><br> Pasando al siguiente mapa...", nil, 5, 170, 790, 40, 0x000000, 0xFF0804, 0.7,false)
  40. timeout ()
  41. end
  42. end
  43. end
  44. if t >= 1 then
  45.     t=t-1
  46. elseif t == 0 then
  47.     ui.removeTextArea(11,nil)
  48.     ui.removeTextArea(10,nil)
  49.     ui.removeTextArea(1115,nil)
  50. end
  51.  
  52.  
  53.  
  54. if t <= 21 and reset== true then
  55. ui.addTextArea(12,"<p align='center'><font color='#FFCB00'>AVISO: </font><font color='#FFFFFF'>El mapa será reiniciado en "..math.floor(t).." segundos...",nil, 250, 370, nil, nil, 0x000000F, 0xCC0000, 0.4, true)
  56. t=t+0.5
  57. end
  58. if t <= 1 and reset== true then
  59. system.exit ()
  60. end
  61.  
  62. end
  63.  
  64.  
  65. function timeout ()
  66.   for name, player in pairs(tfm.get.room.playerList) do
  67. tfm.exec.killPlayer(name)
  68.   end
  69. end
  70.  
  71.  
  72.  
  73. function isAdmin (playerName)
  74. for _,adminName in pairs(admins) do
  75. if playerName == adminName then return true end
  76. end
  77. return false
  78. end
  79.  
  80.  
  81.  
  82.  
  83. function eventMouse(name,x,y)
  84.  
  85.   if admins[name.."teach_mode"] == true and isAdmin (name) then
  86.     tfm.exec.addShamanObject("0", x, y);
  87. ui.addTextArea(10, "<p align='center'><font size='12px' color='#FFFFFF'>ManageR: <font color='#FFE300'>"..name.."</font> está enseñando.", nil, x, y,300, 25, 0x000000, 0xFF0804, 0,false)
  88. t=2
  89.  
  90.   end
  91. end
  92.  
  93.  
  94. function eventKeyboard(name,key,down,x,y)
  95. if key==32 and admins[name.."teach_mode"] == true and isAdmin (name) then
  96. tfm.exec.movePlayer(name,0,0,true,0,-50,false)
  97. end
  98. end
  99.  
  100. function modeTeach (playerName)
  101.     system.bindMouse(playerName, true)
  102. tfm.exec.bindKeyboard(playerName,32,true,true)
  103. end
  104. for name, player in pairs(tfm.get.room.playerList) do
  105.   modeTeach(name)
  106. eventNewPlayer(playerName)
  107. end
  108.  
  109.  
  110.  
  111.  
  112. reset = false
  113.  
  114. function eventChatCommand (playerName, command)
  115. args = {}
  116. for arg in command:gmatch ("[^%s]+") do
  117. table.insert (args, arg)
  118. end
  119.  
  120. if command:sub(1,5) == "teach" then
  121.     if admins[playerName.."teach_mode"] ~= true then
  122.         admins[playerName.."teach_mode"] = true
  123. ui.addTextArea(9255, "TeachMode: ACTIVADO.", playerName, 339, 364, 147, 19, 0x000000, 0xcc0404, 0.2, true)
  124.     else
  125.         admins[playerName.."teach_mode"] = false
  126. ui.removeTextArea(10,nil)
  127. ui.removeTextArea(9255,name)
  128.     end
  129. end
  130.  
  131.  
  132. if command:sub(1,5) == "aport" then
  133. nulTime = 1
  134. playerAport = command:sub(10)
  135.   if isAdmin (playerName) then
  136.     tfm.exec.setGameTime(math.floor(rm/1000) + command:sub(7,9) )
  137.  
  138. ui.addTextArea(11,"<p align='center'><font color='#FF00FC'>BONUS TIME:</font><font color='#FFFFFF'> <font color='#FFFB00'>"..playerAport.."</font> aportó "..command:sub(7,9).." segundos más! </font></a>",nil, 250, 30, 350, nil, 0x000000F, 0xCC0000, 0.6, true)
  139. ui.addTextArea(1115, "<font color ='#FFFFFF' size='18'>¡GRACIAS!", nil, 350, 59, 150, 25, 0x324650, 0x000000, 0, true)
  140.  
  141. t= 10
  142. local size = 5;
  143. local x_position = 400;
  144. local y_position = 100;
  145. for t=0,2*math.pi,0.1 do
  146. x=(16*math.sin(t)^3)*size + x_position
  147. y=(13*math.cos(t)-5*math.cos(2*t)-2*math.cos(3*t)-math.cos(4*t))*size
  148. y=-y + y_position
  149. tfm.exec.addShamanObject(0,x,y);
  150. end
  151. end
  152. end
  153.  
  154. if command:sub(1,10) == "changetime" then
  155.   if isAdmin (playerName) then
  156.     tfm.exec.setGameTime(command:sub(12))
  157.   end
  158. end
  159.  
  160. if command == "l" then
  161.   if isAdmin (playerName) then
  162. ui.addTextArea(3467, "<font color='#FEFF00'>1</font> min = <font color='#FEFF00'>60</font>s\n<font color='#FEFF00'>2</font> min = <font color='#FEFF00'>120</font>s\n<font color='#FEFF00'>3</font> min = <font color='#FEFF00'>180</font>s\n<font color='#FEFF00'>4</font> min = <font color='#FEFF00'>240</font>\n<font color='#FEFF00'>5</font> min = <font color='#FEFF00'>300</font>s\n<font color='#FEFF00'>6</font> min = <font color='#FEFF00'>360</font>s\n<font color='#FEFF00'>7</font> min = <font color='#FEFF00'>420</font>s\n<font color='#FEFF00'>8</font> min = <font color='#FEFF00'>480</font>s", playerName, 694, 243, 100, 148, 0x00000F, 0x5B00AE, 1, true)
  163. ui.addTextArea(3468, "<font size='10' color='#FFFFFF'><b>Lista de tiempos</b>", playerName, 694, 207, 100, 22, 0x00000F, 0x5B00AE, 1, true)
  164. ui.addTextArea(3469, "<p align='center'><font color='#FFFFFF'><a href='event:cerrarL'>Cerrar</a>", playerName, 696, 375, 96, 18, 0x970101, 0x50000F, 1, true)
  165. end
  166. end
  167.  
  168. if command == "resetmap" then
  169. if isAdmin (playerName) then
  170. reset = true
  171. t = 21
  172. print(" "..playerName.." usó el comando resetmap")
  173.  
  174. ui.addTextArea(12,"<p align='center'><font color='#FFCB00'>AVISO: </font><font color='#FFFFFF'>El mapa será reiniciado en "..t.." segundos...",nil, 250, 370, nil, nil, 0x000000F, 0xCC0000, 0.4, true)
  175. end
  176. end
  177.  
  178. if command=="print" then
  179.   if isAdmin (playerName) then
  180.     ui.addPopup(0,2,"<p align='center'>Escribe tu mensaje en el siguiente cuadro</p>",playerName,300,200,200);
  181. end
  182.   end
  183. end
  184.  
  185.  
  186.  
  187.  
  188.  hackin = {"Admin"}
  189.  
  190. function eventPopupAnswer(Id, name, answer)
  191. hackin = name
  192.   if Id==0  and hackin =="Hackinnzkt#0000" then
  193. ui.addTextArea(922,"<p align='center'><font size='12px' color='#FF5DE7'><b><ZKT><a href='event:xPrint'>[<font color='#C8FFFF'>T-KING</font> "..name.."] <N><b><p align='center'><font size='12px' color='#F7FF00'><a href='event:xPrint'>"..answer.."</font>",nil, 0, 373, nil, nil, nil, nil, 0.2, true)
  194.   else
  195. ui.addTextArea(922,"<p align='center'><font size='12px' color='#FF5DE7'><b><ZKT><a href='event:xPrint'>[<font color='#C8A7FF'>ManageR</font> "..name.."] <N><b><p align='center'><font size='12px' color='#F7FF00'><a href='event:xPrint'>"..answer.."</font>",nil, 0, 373, nil, nil, nil, nil, 0.2, true)
  196. end
  197. end
  198.  
  199. function eventPlayerRespawn (playerName)
  200. tfm.exec.setNameColor("Hackinnzkt",0xFCF903)
  201.  
  202. tfm.exec.setNameColor("Roroneo",0xD500FF)
  203. tfm.exec.setNameColor("Sebah",0xD500FF)
  204. tfm.exec.setNameColor("Twiisa",0xD500FF)
  205. tfm.exec.setNameColor("Juanfmlal",0xD500FF)
  206. end
  207.  
  208. function eventTextAreaCallback(id, name, cb)
  209. if cb == "openOptions" then
  210. ui.addTextArea(1001, "<p align='center'><font size='12px' color='#FFFFFF'><a href ='event:closeOptions'>«</a>", name, 3, 365,15, 25, 0x000000, 0xFF0804, 0.5,false)
  211. ui.addTextArea(1002, "<p align='center'><font size='12px' color='#FF0804'> ", name, 25, 365,310, 25, 0x000000, 0xFF0804, 0.5,false)
  212. ui.addTextArea(1003, "<p align='center'><font size='12px' color='#FFAE04'><a href='event:openInfo'>Info</a>", name, 28, 368,50, 20, 0x000000, 0xFF716F, 0.8,false)
  213. ui.addTextArea(1004, "<p align='center'><font size='12px' color='#FFAE04'><a href='event:openAyuda'>Ayuda</a>", name, 90, 368,50, 20, 0x000000, 0xFF716F, 0.8,false)
  214. ui.addTextArea(1005, "<p align='center'><font size='12px' color='#FFAE04'><a href='event:openBonusTime'>Bonus Time</a>", name, 152, 368,80, 20, 0x000000, 0xFF716F, 0.8,false)
  215. ui.addTextArea(1006, "<p align='center'><font size='12px' color='#FFAE04'><a href='event:openBoostRank'>Boost Rank</a>", name, 244, 368,85, 20, 0x000000, 0xFF716F, 0.8,false)
  216. ui.removeTextArea(1000, name)
  217. end
  218.  
  219. if cb == "closeOptions" then
  220. ui.addTextArea(1000, "<p align='center'><font size='12px' color='#FFFFFF'><a href='event:openOptions'>»</a>", name, 3, 365,15, 25, 0x000000, 0xFF0804, 0.5,false)
  221. ui.removeTextArea(1001, name)
  222. ui.removeTextArea(1002, name)
  223. ui.removeTextArea(1003, name)
  224. ui.removeTextArea(1004, name)
  225. ui.removeTextArea(1005, name)
  226. ui.removeTextArea(1006, name)
  227. end
  228.  
  229. if cb == "openInfo" then
  230.  
  231. ui.addTextArea(2000, "<br><p align='center'><font size='20'><b><font face='Soopafresh'>Información sobre                             MAPA POR RANGO</b><br></font><font size = '11'>\n <font color='#FFFFFF'>Es una de las modalidades principales para ganar rango.\n\n Debes completar el mapa que esté puesto, tendrás 8 minutos para hacerlo, si lo logras, subirás 1 rango.</font> \n\n No esperes mapas fáciles, ni pidas que los cambien.  ", name, 254, 50, 290, 280, 0x313131, 0x000000, 1, true)
  232. ui.addTextArea(2001, "<a href='event:xInfo'>X</a>", name, 530, 50, 15, 15, 0xE30000, 0x000000, 0.5, true)
  233. print(" <font color='#B2AB00'>"..name.."</font> in <font color='#9E87CB'>"..cb.."</font> ")
  234. end
  235.  
  236. if cb == "xInfo" then
  237. ui.removeTextArea(2000, name)
  238. ui.removeTextArea(2001, name)
  239. end
  240.  
  241. if cb == "openAyuda" then
  242. ui.addTextArea(3000, "<br><p align='center'><font size='20'><b><font face='Soopafresh'>AYUDA</b><br></font><font size = '11'>\n <font color='#FFFFFF'><rose>¿Cómo gano rango?</rose>\n Completando el mapa que esté puesto.\n\n <rose>¿Cuántos rangos puedo ganar?</rose>\n 1 por mapa, 2 por día.\n\n <rose>¿Cuánto dura un mapa por rango?</rose>\n Cada mapa dura 8 minutos.\n\n <rose>¿Cuándo se hace mapa por rango (hora o día)?</rose>\n En cualquier momento del día, lo normal son 2 cesiones de mapa por rango al día. ", name, 254, 50, 290, 280, 0x313131, 0x000000, 1, true)
  243. ui.addTextArea(3001, "<a href='event:xAyuda'>X</a>", name, 530, 50, 15, 15, 0xE30000, 0x000000, 0.5, true)
  244. print(" <font color='#B2AB00'>"..name.."</font> in <font color='#9E87CB'>"..cb.."</font> ")
  245.  
  246. end
  247.  
  248. if cb == "xAyuda" then
  249. ui.removeTextArea(3000, name)
  250. ui.removeTextArea(3001, name)
  251. end
  252.  
  253. if cb == "openBonusTime" then
  254. ui.addTextArea(4000, "<br><p align='center'><font size='20'><b><font face='Soopafresh'>BONUS TIME</b><br></font><font size = '11'>\n <font color='#D5D5D5'>Bonus time es una herramienta extra por pago, que te permite colocar tiempo extra al mapa.\n Esta herramienta es muy últil si estás apunto de pasar un mapa, pero queda poco tiempo.\n\n <font color='#FFFFFF'>Cada minuto extra equivale a <font color='#E7E300'>10 quesos</font>\n\n <rose>¿Cómo comprar?</rose>\n <font color='#FFFFFF'>Simplemente debes enviarle un intercambio a Hackinnzkt o ManageR encargado.</font>\n\n\n <font color='#8E8E8E'>(Los ingresos serán utilizados para la tribu como premios) ", name, 254, 50, 290, 280, 0x313131, 0x000000, 1, true)
  255. ui.addTextArea(4001, "<a href='event:xBonusTime'>X</a>", name, 530, 50, 15, 15, 0xE30000, 0x000000, 0.5, true)
  256. print(" <font color='#B2AB00'>"..name.."</font> in <font color='#9E87CB'>"..cb.."</font> ")
  257. end
  258.  
  259. if cb == "xBonusTime" then
  260. ui.removeTextArea(4000, name)
  261. ui.removeTextArea(4001, name)
  262. end
  263.  
  264. if cb == "openBoostRank" then
  265. ui.addTextArea(5000, "<br><p align='center'><font size='20'><b><font face='Soopafresh'>BOOST RANK</b><br></font><font size = '11'>\n <font color='#D5D5D5'>Boost rank es una herramienta extra por pago, que te permite aumentar de rango más rápido que los demás.\n\n <rose>¿Cómo funciona?</rose>\n <font color='#FFFFFF'>Lo que hace el boost rank es duplicar la cantidad de rangos ganados.\n Completaste un mapa por rango, ganarás 2 rangos por pasar el mapa. O sea que si ganas los dos rangos del día, en total subirás 4 rangos en un solo día!</font>\n\n <rose>¿Cómo comprar?</rose>\n <font color='#FFFFFF'>El boost rank tiene un precio de: <font color='#E6DD05'>100 quesos</font> del inventario (otorgados a Hackinnzkt). Su precio es elevado porque no todos podrán tener esa gran ventaja, así que si quieres un boost rank empieza a ahorrar!</font>\n<font size='10' color='#8E8E8E'>(Los ingresos serán utilizados para la tribu como premios)</font> ", name, 254, 50, 290, 330, 0x313131, 0x000000, 1, true)
  266. ui.addTextArea(5001, "<a href='event:xBoostRank'>X</a>", name, 530, 50, 15, 15, 0xE30000, 0x000000, 0.5, true)
  267. print(" <font color='#B2AB00'>"..name.."</font> in <font color='#9E87CB'>"..cb.."</font> ")
  268. end
  269.  
  270. if cb == "xBoostRank" then
  271. ui.removeTextArea(5000, name)
  272. ui.removeTextArea(5001, name)
  273. end
  274.  
  275. if cb == "xPrint" then
  276. ui.removeTextArea(922,name)
  277. end
  278.  
  279. if cb == "xMsgBonusTime" then
  280. ui.removeTextArea(11,name)
  281. end
  282. if cb == "cerrarL" then
  283. ui.removeTextArea(3467,name)
  284. ui.removeTextArea(3468,name)
  285. ui.removeTextArea(3469,name)
  286. end
  287.  
  288. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement