Advertisement
Guest User

Untitled

a guest
Oct 26th, 2013
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.19 KB | None | 0 0
  1. ---------------------By Nicknamepll
  2. --------------Minigame name Speedracing
  3. -------------21.10.13
  4.  
  5.  
  6. ----- Komendy -----
  7.  
  8.  
  9. tfm.exec.setNameColor("Nicknamepll", 0xFF1900)
  10.         tfm.exec.setNameColor("Ouake", 0xFF1900)
  11. system.disableChatCommandDisplay("off",true)
  12. system.disableChatCommandDisplay("help",true)
  13. system.disableChatCommandDisplay("pomoc",true)
  14. tfm.exec.disableAutoTimeLeft (true)
  15. tfm.exec.disableAutoShaman(true)
  16.  
  17.  
  18. ----- Bindowanie -----
  19.  
  20.  
  21.  
  22. function eventNewPlayer(playerName)
  23. tfm.exec.bindKeyboard(playerName,37,true,true)
  24. tfm.exec.bindKeyboard(playerName,39,true,true)
  25. tfm.exec.bindKeyboard(playerName,65,true,true)
  26. tfm.exec.bindKeyboard(playerName,68,true,true)
  27. end
  28.  
  29. for playerName,player in pairs(tfm.get.room.playerList) do
  30. tfm.exec.bindKeyboard(playerName,37,true,true)
  31. tfm.exec.bindKeyboard(playerName,39,true,true)
  32. tfm.exec.bindKeyboard(playerName,65,true,true)
  33. tfm.exec.bindKeyboard(playerName,68,true,true)
  34. end
  35.  
  36.  
  37.  
  38. ----- Szybkość -----
  39.  
  40.  
  41.  
  42.  
  43. function eventKeyboard(playerName,key,down,x,y)
  44. if key==37 or key == 65 then
  45. tfm.exec.movePlayer(playerName, 0, 0, true, -20, 0, true)
  46. elseif key==39 or key==68 then
  47. tfm.exec.movePlayer(playerName, 0, 0, true, 20, 0, true)
  48. end
  49. end
  50.  
  51.  
  52.  
  53.  
  54. ----- Gra -----
  55.  
  56.  
  57.  
  58.  
  59.  
  60. function main()
  61.         tfm.exec.disableAutoNewGame (true);
  62.         tfm.exec.disableAutoShaman(true);
  63.         tfm.exec.disableAutoTimeLeft (true);
  64.         tfm.exec.disableAutoScore (true);
  65.         tfm.exec.disableAfkDeath (true);
  66. end
  67.  
  68.  
  69. ----- Pasek z Informacjami -----
  70.  
  71.  
  72. function eventNewGame()
  73.         tfm.exec.setUIMapName("<P>Speedracing!</P>")
  74.         tfm.exec.setGameTime(60*1)
  75.         tfm.exec.setUIShamanName ("<L>Miłej zabawy!</L>")
  76. end
  77.  
  78.  
  79. ----- Rotacja map -----
  80.  
  81.  
  82.  
  83. tfm.exec.disableAutoNewGame(true)
  84. maps={"@2134537", "@333714",  "@333714", "@445219", "@333714", "@445219", "@2546484", "@333714", "@445219", "@2546484", "@406266", "@333714", "@445219", "@2546484", "@406266", "@669031", "@1378209", "@263163", "@798953", "@333714", "@798953", "@333714", "@445219", "@2546484", "@406266", "@669031", "@1378209", "@263163",}
  85.  
  86. function eventLoop(time,remaining)
  87.     if remaining<=0 then
  88.         tfm.exec.newGame(maps[math.random(#maps)])
  89.     end
  90. end
  91.  
  92. function eventPlayerDied()
  93.     local i=0
  94.     for n,player in pairs(tfm.get.room.playerList) do
  95.         if not player.isDead then
  96.             i=i+1
  97.         end
  98.     end
  99.     if i==0 then
  100.         tfm.exec.newGame(maps[math.random(#maps)])
  101.     end
  102. end
  103.  
  104. function eventPlayerWon(name)
  105. end
  106.  
  107. function eventPlayerDied(name)
  108. end
  109.  
  110.  
  111. for name,player in pairs(tfm.get.room.playerList) do
  112.         system.bindMouse(name, true)
  113. end
  114.  
  115. function eventNewPlayer(name)
  116.             tfm.exec.bindKeyboard(name,32,true,true)
  117.         tfm.exec.respawnPlayer(name);
  118.          tfm.exec.setUIShamanName("<J>Speed</J>")
  119. end
  120.  
  121.  
  122.  
  123. ----- Callbacki -----
  124.  
  125.  
  126.  
  127. ui.addTextArea(0, "<a href='event:help'>Changelog & Commands</a>", nil, nil, nil, nil, "0x6A7495", "0x6A7495", nil)
  128.  
  129. function eventTextAreaCallback(id,name,cb)
  130.  if cb=='help' then
  131.   ui.addTextArea(1, "<br ><ROSE>CHANGELOG</ROSE><br /><br >Add new map  <ROSE>- V 0.0.2 -</ROSE><br /><br >Add Callback <ROSE>- V 0.0.3 -</ROSE><br >Fixed some bugs <ROSE>- V 0.0.4 -</ROSE><br /><br ><ROSE>COMMANDS<br /></ROSE> - Lista pomocników.<br ><J>'!pomocnicy'</J> - <br /></ROSE><br /></ROSE>Lista testerów.<br /> <br ><J>'!testerzy'</J> - <br /></ROSE>Automatycznie zabija mysz<br /> - <br ><J>'!mort'</J><br /></ROSE></ROSE>\n<br><br><a href='event:close'><VP>Zamknij</VP></a>", name)
  132.  end
  133. if cb=='close' then
  134.   ui.removeTextArea(1, name)
  135.  end
  136. end
  137.  
  138. print '<rose>Version 0.0.4</rose> - <J>Fixed some bugs'
  139. print '<VP> By Nicknamepll'
  140.  
  141. ----- Wszystkie Komendy dla graczy -----
  142.  
  143.  
  144. function eventChatCommand(playerName, com)
  145.           if com == 'pomocnicy' then
  146.             ui.addPopup(1,0,"Shamousey, Woterek, Szel, Ouake i Tomiek",playerName,175,200,450)
  147.           else if com == 'testerzy' then
  148.              ui.addPopup(1,0,"Ouake, Szel, Tomiek i Vuouv",playerName,175,200,450)
  149.           else if com == 'mort' then
  150.             tfm.exec.killPlayer(playerName)
  151.           else if com == 'off' then
  152.             system.exit()
  153. end
  154. end
  155. end
  156. end
  157. end
  158.  
  159.  
  160.  
  161. --------------------------- Version 0.0.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement