Nicknamepll

a

Jun 24th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.15 KB | None | 0 0
  1. -------------------
  2. ------FlyFFA-------
  3. ----Nicknamepll----
  4. -----Aanguson------
  5. -------------------
  6.  
  7. tfm.exec.chatMessage("Witam w <rose>FlyFFA</rose>! Aby wypuścić kule kliknij S lub strzałke w dół. Miłej gry życzą <rose>Nicknamepll</rose> i <rose>Aanguson</rose>",nil)
  8.  
  9. admin='Nicknamepll'
  10. admin1='Aanguson'
  11.  
  12. mod={'...'}
  13. --Główne opcje i bindy
  14. version="2.5.0"
  15. kp={}
  16. stats={}
  17. Id = {}
  18. pop = 0
  19. wcn={}
  20. pkt={}
  21. lat={}
  22. kup={}
  23. function eventNewGame()
  24. for k,v in pairs(stats) do
  25. stats[k].played = stats[k].played + 1
  26. end
  27. started=false
  28. tfm.exec.setUIMapName("<BL>#<VP>Fly<T>FFA")
  29. ui.addTextArea(303,"<B><C>FlyFFA! Wersja "..version.." Stworzone przez Aanguson & Nicknamepll",n,-4,-20,0,0,n,n,0,true)
  30. ui.removeTextArea(301)
  31. tfm.exec.setNameColor(admin1, 0xFF1900)
  32. tfm.exec.setNameColor(admin, 0xFF1900)
  33. end
  34.  
  35. for komendy in pairs({"off","k","pkt","q"}) do
  36. system.disableChatCommandDisplay(komendy,true)
  37. end
  38.  
  39. players={}
  40. toDespawn={}
  41. function eventNewPlayer(name)
  42. system.bindMouse(name, true)
  43. for i,keys in ipairs({32,37,39,81,68,65,40,83,80,79,72,74,73}) do
  44. tfm.exec.bindKeyboard(name,keys,true,true)
  45. end
  46. players[name]={
  47. timestamp=os.time(),
  48. offsets={x=2, y=10}
  49. }
  50. stats[name]={won=0, played=0, lost=0}
  51. Id[name] = pop
  52. wcn[name]=0
  53. pkt[name]=0
  54. kp[name]=0
  55. lat[name]=0
  56. kup[name]=0
  57. end
  58. for name,player in pairs(tfm.get.room.playerList) do
  59. eventNewPlayer(name)
  60. pop = pop + 1
  61. end
  62.  
  63. tfm.exec.disableAutoShaman(true)
  64. tfm.exec.disableAutoNewGame(true)
  65. tfm.exec.disableAutoTimeLeft(true)
  66. tfm.exec.disableAutoScore(true)
  67. tfm.exec.disableAfkDeath(true)
  68. maps={4479038,521833,401421,541917,541928,541936,541943,527935,559634,559644,888052,878047,885641, 770600,770656,772172,891472,589736,589800,589708,900012,901062,754380,901337,901411,907870,910078,1190467,1252043,1124380, 1016258,1252299,1255902,1256808,986790,1285380,1271249,1255944,1255983,1085344,1273114,1276664,1279258,1286824,1280135,1280342,1284861, 1287556,1057753,1196679,1288489,1292983,1298164,1298521,1293189,1296949,1308378,1311136,1314419,1314982,1318248,1312411,1312589,1312845, 1312933,1313969,1338762,1339474,1349878,1297154,644588,1351237,1354040,1354375,1362386,1283234,1370578,1306592,1360889,1362753,1408124, 1407949,1407849,1343986,1408028,1441370,1443416,1389255,1427349,1450527,1424739,869836,1459902,1392993,1426457,1542824,1533474,1561467, 1563534,1566991,1587241,1416119,1596270,1601580,1525751,1582146,1558167,1420943,1466487,1642575,1648013,1646094,1393097,1643446,1545219, 1583484,1613092,1627981,1633374,1633277,1633251,1585138,1624034,1616785,1625916,1667582,1666996,1675013,1675316,1531316,1665413,1681719, 1699880,1688696,623770,1727243,1531329,1683915,1689533,1738601,3756146,912118,3326933,3722005,3566478,1456622,1357994,1985670,1884075, 1708065,1700322,2124484,3699046,2965313,4057963,4019126,3335202,2050466}
  69. tfm.exec.newGame(maps[math.random(#maps)])
  70. --Kod
  71. function eventPlayerDied(n)
  72. local i=0
  73. local n
  74. for pname,player in pairs(tfm.get.room.playerList) do
  75. if not player.isDead then
  76. i=i+1
  77. n=pname
  78. end
  79. end
  80. if i==1 then
  81. tfm.exec.giveCheese(n)
  82. tfm.exec.playerVictory(n)
  83. tfm.exec.setGameTime(5)
  84. end
  85. end
  86.  
  87. function eventPlayerWon(name)
  88. ui.addTextArea(301,"<B><font color='#00B2FF' face='Comic Sans MS' size='40'>" ..name.. " zwyciężył/-a </font>",n,140,200,0,0,n,n,0,true)
  89. tfm.exec.setPlayerScore(name, 0+1, true)
  90. stats[name].won=stats[name].won+1
  91. pkt[name]=pkt[name]+1
  92. end
  93.  
  94. function eventChatCommand(name,command)
  95. local arg={}
  96. for argument in command:gmatch("[^%s]+") do
  97. table.insert(arg,argument)
  98. end
  99. if arg[1]=="off" then
  100. if tonumber(arg[2]) and tonumber(arg[3]) then
  101. players[name].offsets.x=tonumber(arg[2])
  102. players[name].offsets.y=tonumber(arg[3])
  103. else
  104. players[name].offsets.x=2
  105. players[name].offsets.y=10
  106. end
  107. if arg[1]=='k' then
  108. if arg[2]=='l' then
  109. if arg[3]=='1' and pkt[name]>=10 and kup[name]==0 then
  110. pkt[name]=pkt[name]-10
  111. lat[name]=1
  112. kup[name]=1
  113. elseif arg[3]=='2' and pkt[name]>=10 and kup[name]==1 then
  114. pkt[name]=pkt[name]-20
  115. lat[name]=2
  116. kup[name]=2
  117. elseif arg[3]=='3' and pkt[name]>=10 and kup[name]==2 then
  118. pkt[name]=pkt[name]-30
  119. lat[name]=3
  120. kup[name]=3
  121. elseif not arg[2] or not arg[3] or not arg[2] and not arg[3] then
  122. print("Błąd")
  123. end
  124. end
  125. end
  126. if name==admin or name==admin1 then
  127. if arg[1]=='pkt' then
  128. pkt[arg[2]]=tonumber(arg[3])
  129. elseif arg[1]=='q' then
  130. tfm.exec.chatMessage(name,"["..name.."] "..arg[2])
  131. end
  132. end
  133. end
  134. end
  135.  
  136. function eventKeyboard(name,key,down,x,y)
  137. if (key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
  138. if players[name].timestamp < os.time()-1000 then
  139. local id
  140. if tfm.get.room.playerList[name].isFacingRight then
  141. id=tfm.exec.addShamanObject(19,x-players[name].offsets.x,y+players[name].offsets.y)
  142. wcn[name]=wcn[name]+1
  143. else
  144. id=tfm.exec.addShamanObject(20,x+players[name].offsets.x,y+players[name].offsets.y)
  145. wcn[name]=wcn[name]+1
  146. end
  147. players[name].timestamp=os.time()
  148. table.insert(toDespawn,{os.time(),id})
  149. end
  150. elseif key==32 and lat[name]==0 then
  151. tfm.exec.movePlayer(name,0,0,true,0,-20,false)
  152. elseif key==32 and lat[name]==1 then
  153. tfm.exec.movePlayer(name,0,0,true,0,-30,false)
  154. elseif key==32 and lat[name]==2 then
  155. tfm.exec.movePlayer(name,0,0,true,0,-40,false)
  156. elseif key==32 and lat[name]==3 then
  157. tfm.exec.movePlayer(name,0,0,true,0,-50,false)
  158. elseif key==80 then
  159. local form = [[
  160. Wygrane rundy : %d
  161. Rozegrane rundy : %d
  162. ]]
  163. form = form:format(stats[name].won, stats[name].played)
  164. ui.addTextArea(2000,"",name,249,99,271,218,0x27373f,0x27373f,1,true)
  165. ui.addTextArea(1,"<font size='15'><p algin='left'>\n\n"..form.."Wystrzelonych kul : "..wcn[name].."\nIlość punktów : "..pkt[name].."\nOffsety:\n X:"..players[name].offsets.x.."\n Y:"..players[name].offsets.y.."</p></font>",name,252,120,265,195,0x324650,0x324650,1,true)
  166. ui.addTextArea(20,"",name,250,99,270,12,0x27373f,0x27373f,1,true)
  167. ui.addTextArea(0,"<font size='15' color='#009D9D'><b>"..name.."</b></font>",name,250,94,272,25,0,0,1,true)
  168. ui.addTextArea(200,"",name,508,100,10,10,0x009D9D,0x009D9D,1,true)
  169. ui.addTextArea(2,"<font size='15' color='#27373f'><a href='event:z'><b>x</b></a></font>",name,506,93,20,25,0,0,1,true)
  170. elseif key==79 then
  171. ui.addTextArea(2000,"",name,249,70,410,308,0x27373f,0x27373f,1,true)
  172. ui.addTextArea(1,"<p algin='left'>\n\n<font face='Comic Sans MS' color='#BABD2F ' size='10' >[Wersja 1.0.0]</font><font size='10' > - Wystartowanie Minigry</font>\n<font face='Comic Sans MS' color='#BABD2F' size='10' >[Wersja 2.0.0]</font><font size='10' >- Dodano:\n •Komende !off X Y\n •Małe cechy umilające rozgrywke.\n - Małe zmiany w lataniu\n</font><font face='Comic Sans MS' color='#BABD2F' size='10' >[Wersja 2.1.0]</font><font size='10' > - Dodano:\n• Profil (P)\n •Ogłoszenia (O)\n •Pomoc (H)</font><font face='Comic Sans MS' color='#BABD2F' size='10' >\n[Wersja 2.3.0]</font><font size='10' > - Dodano:\n •Listę administratorów i moderatorów (J)</font>\n<font color='#babd2f' face='comic sans ms' size='10'>[Wersja 2.4.0]</font> - Dodano:\n •Zmiany w wyglądzie profilu (P) \n •Ogłoszeń (O) \n •Pomocy (H) \n •Liście administracji (J)</font>\n<font face='Comic Sans MS' color='#BABD2F' size='10' >[Wersja 2.5.0]</font><font size='10'> - Naprawiono:\n • Offsety (miejsce spawnowania kuli właściwe do strony myszy)\n - Dodano:\n • Sklep (komenda !kup latanie {1,2,3}*)\n •Offsety w profilu</font></p>",name,252,70,405,305,0x324650,0x324650,1,true)
  173. ui.addTextArea(20,"",name,250,70,406,12,0x27373f,0x27373f,1,true)
  174. ui.addTextArea(0,"<font size='15' color='#009D9D'><b>Ogłoszenia</b></font>",name,250,65,272,25,0,0,1,true)
  175. ui.addTextArea(200,"",name,646,70,10,10,0x009D9D,0x009D9D,1,true)
  176. ui.addTextArea(2,"<font size='15' color='#27373f'><a href='event:z'><b>x</b></a></font>",name,644,63,20,25,0,0,1,true)
  177.  
  178. elseif key==72 then
  179. ui.addTextArea(2000,"",name,249,99,271,218,0x27373f,0x27373f,1,true)
  180. ui.addTextArea(1,"<font size='13'><p algin='left'>\n\nAby wypuścić kulę naciśnij Strzałke\nw dół lub S. Aby latać naciśnij Spacje.</p></font>",name,252,120,265,195,0x324650,0x324650,1,true)
  181. ui.addTextArea(20,"",name,250,99,270,12,0x27373f,0x27373f,1,true)
  182. ui.addTextArea(0,"<font size='15' color='#009D9D'><b>Pomoc</b></font>",name,250,94,272,25,0,0,1,true)
  183. ui.addTextArea(200,"",name,508,100,10,10,0x009D9D,0x009D9D,1,true)
  184. ui.addTextArea(2,"<font size='15' color='#27373f'><a href='event:z'><b>x</b></a></font>",name,506,93,20,25,0,0,1,true)
  185. elseif key==74 then
  186. ui.addTextArea(2000,"",name,249,99,271,218,0x27373f,0x27373f,1,true)
  187. ui.addTextArea(1,"Admini to: Nicknamepll i Aanguson",name,252,120,265,195,0x324650,0x324650,1,true)
  188. ui.addTextArea(20,"",name,250,99,270,12,0x27373f,0x27373f,1,true)
  189. ui.addTextArea(0,"<font size='15' color='#009D9D'><b>Administracja</b></font>",name,250,94,272,25,0,0,1,true)
  190. ui.addTextArea(200,"",name,508,100,10,10,0x009D9D,0x009D9D,1,true)
  191. ui.addTextArea(2,"<font size='15' color='#27373f'><a href='event:z'><b>x</b></a></font>",name,506,93,20,25,0,0,1,true)
  192. end
  193. end
  194. print("FlyFFA by Aanguson & Nicknamepll")
  195.  
  196. function eventLoop(time,remaining)
  197. if time >= 3000 and not started then
  198. started=true
  199. end
  200. if remaining<=0 then
  201. tfm.exec.newGame(maps[math.random(#maps)])
  202. end
  203. for i,cannon in ipairs(toDespawn) do
  204. if cannon[1] <= os.time()-3000 then
  205. tfm.exec.removeObject(cannon[2])
  206. table.remove(toDespawn,i)
  207. end
  208. end
  209. end
  210. ui.addTextArea(3,"<a href='event:i'>Info</a>",nil,4,24,30,nil, nil, nil, 1, true)
  211.  
  212. function eventTextAreaCallback(id,name,cb)
  213. if cb=="i" then
  214. ui.addTextArea(2000,"",name,249,99,271,218,0x27373f,0x27373f,1,true)
  215. ui.addTextArea(1,"<p align='center'><font size='20'>\nWitaj </font><font size='20' face='Comic sans MS' color='#009D9D'></font></p>#FlyFFA polega na zepchnięciu innych myszek i wygraniu gry! \n<font color='#babd2f'>H</font> - Więcej informacji \n<font color='#babd2f'>P</font> - Profil \n<font color='#babd2f'>O</font> - Ogłoszenia \n<font color='#babd2f'>J</font> - Pokazuje listę administratorów\n\nMiłej gry życzą</p> <font color='#FF1900'>Aanguson & Nicknamepll</font>",name,252,120,265,195,0x324650,0x324650,1,true)
  216. ui.addTextArea(20,"",name,250,99,270,12,0x27373f,0x27373f,1,true)
  217. ui.addTextArea(0,"<font size='15' color='#009D9D'><b>Info</b></font>",name,250,94,272,25,0,0,1,true)
  218. ui.addTextArea(200,"",name,508,100,10,10,0x009D9D,0x009D9D,1,true)
  219. ui.addTextArea(2,"<font size='15' color='#27373f'><a href='event:z'><b>x</b></a></font>",name,506,93,20,25,0,0,1,true)
  220. elseif cb=="z" then
  221. ui.removeTextArea(1,name)
  222. ui.removeTextArea(2,name)
  223. ui.removeTextArea(0,name)
  224. ui.removeTextArea(10,name)
  225. ui.removeTextArea(12,name)
  226. ui.removeTextArea(13,name)
  227. ui.removeTextArea(123,name)
  228. ui.removeTextArea(122,name)
  229. ui.removeTextArea(124,name)
  230. ui.removeTextArea(11,name)
  231. ui.removeTextArea(20,name)
  232. ui.removeTextArea(2000,name)
  233. ui.removeTextArea(200,name)
  234. end
  235. end
Advertisement
Add Comment
Please, Sign In to add comment