Advertisement
Guest User

Untitled

a guest
May 1st, 2016
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 63.06 KB | None | 0 0
  1. ------------------
  2. -- UTHS by Szel ----- Translated in RO by Posesyon --
  3. -- version 1.3 --
  4. ------------------
  5.  
  6. ---- CHANGE IT/ ZMIEN TO:
  7. superAdmin = {'nick1'}
  8. admins = {'nick1', 'nick2'}
  9. language = 'ro' -- 'ro' or 'en' or 'pl'
  10.  
  11. -- cd. nie ruszac
  12. version = '1.3'
  13. lang = {}
  14. lang.ro = {
  15. help = [[<p align="center"><font size="19px">Ultimate Tribe House Script</font> v. ]]..version..[[</p><p align="right"><font size="10px" color="#ffffff">created by Szel --- tradus in romana de Posesyon</font></p>Commands:
  16. !cmd - arata comenzile
  17. !set - arata setarile
  18. !help - arata meniul de ajutor
  19. Hotkeys:
  20. h - arata meniul de ajutor
  21. Esc - inchide fereastra
  22. i - arata comenzile
  23. o - arata setarile
  24. m - arata minigame-urile
  25. ]],
  26. disabled = 'Dezactivat',
  27. enabled = 'Activat',
  28. disable = 'Dezactiveaza',
  29. enable = 'Activeaza',
  30. refresh = 'refresh',
  31. close = 'Inchide',
  32. minigames = 'Minigames',
  33. minigame = 'Minigame',
  34. module_stop = '!module stop - pentru a opri minigame-ul',
  35.  
  36. maps_queue = 'mape in asteptare',
  37. queuing = 'Queuing',
  38. played = 'Jucate',
  39. maps2 = 'mape',
  40. delete = 'sterge',
  41. admins = 'Admini',
  42. reset_settings = 'reseteaza setarile',
  43. settings = 'Setari',
  44. commands = 'Comenzi',
  45. for_admins = 'pentru admini',
  46. banned = 'Esti banat',
  47.  
  48. module_des = 'arata lista minigame-urilor',
  49. made_des = 'comanda noua',
  50. kill_des = 'omorari',
  51. ice_des = 'inghetari',
  52. sham_des = 'da shaman',
  53. ch_des = 'da branza',
  54. tp_des = 'teleport',
  55. utp_des = 'dezactiveaza teleport, [unglue player]',
  56. tpp_des = 'teleport cu lipici',
  57. ro_des = 'sterge toate obiectele',
  58. meep_des = 'da meep',
  59. ban_des = 'dezactiveaza comenzile pentru <nume>',
  60. unban_des = 'activeaza comenzile pentru <nume>',
  61. admin_des = 'da admin rank',
  62. unadmin_des = 'withdraws admin rank',
  63. score_des = 'seteaza <player> scor',
  64. mapname_des = 'schimba numele mapei',
  65. shamname_des = 'schimba numele shamanului',
  66. respawn_des = 'respawns',
  67. autorespawn_des = 'on/off autorespawn',
  68. color_des = 'seteaza culoare numelui',
  69. queue_des = 'on/off maps queuing',
  70. maps_des = 'arata mapele in asteptare',
  71. np_des = 'mapele jucate',
  72. npp_des = 'adauga mape in asteptare',
  73. mort_des = 'sinucidere',
  74. off_des = 'dezactiveaza comanda',
  75. on_des = 'activeaza comanda',
  76. cmd_des = 'arata lista comenzilor',
  77. pet_des = 'converteste <nume> in animal de companie',
  78. unpet = 'withdraws !pet',
  79. set_des = 'arata lista setarilor',
  80. xml_des = 'joaca mape din xml code',
  81. house_des = 'seteaza casa tribului',
  82. help_des = 'arata meniul de ajutor',
  83. vampire_des = 'transforma intr-un vampir',
  84. log_des = 'arata !commands log',
  85. queue_set = 'mape in asteptare',
  86. autorespawn_set = 'auto respwan',
  87. autoTimeLeft_set = 'auto schimbare timp',
  88. afk_set = 'AFK death',
  89. autoNewGame_set = 'auto schimbare mapa',
  90. autoScore_set = 'auto score',
  91. autoShaman_set = 'Selectie automata Shaman',
  92. shamanSkills_set = 'skill-urile shaman-ului',
  93. settime_des = 'seteaza timpul jocului',
  94. snow_des = 'sa ninga',
  95. _des = '',
  96. _des = '',
  97. _des = '',
  98.  
  99. }
  100.  
  101. lang.en = {
  102. help = [[<p align="center"><font size="19px">Ultimate Tribe House Script</font> v. ]]..version..[[</p><p align="right"><font size="10px" color="#ffffff">created by Szel</font></p>Commands:
  103. !cmd - shows commands
  104. !set - shows settings
  105. !help - shows help
  106. Hotkeys:
  107. h - shows help
  108. Esc - closes window
  109. i - shows commands
  110. o - shows settings
  111. m - shows minigames
  112. ]],
  113. disabled = 'disabled',
  114. enabled = 'enabled',
  115. disable = 'disable',
  116. enable = 'enable',
  117. refresh = 'refresh',
  118. close = 'close',
  119. minigames = 'Minigames',
  120. minigame = 'Minigame',
  121. module_stop = '!module stop - to turn off minigame',
  122.  
  123. maps_queue = 'Maps queue',
  124. queuing = 'Queuing',
  125. played = 'played',
  126. maps2 = 'maps',
  127. delete = 'delete',
  128. admins = 'Admins',
  129. reset_settings = 'reset settings',
  130. settings = 'Settings',
  131. commands = 'Commands',
  132. for_admins = 'for admins',
  133. banned = 'You are banned',
  134.  
  135. module_des = 'shows list of minigames',
  136. made_des = 'new commend',
  137. kill_des = 'kills',
  138. ice_des = 'freezes',
  139. sham_des = 'gives shaman',
  140. ch_des = 'gives cheese',
  141. tp_des = 'teleport',
  142. utp_des = 'diesables teleport, [unglue player]',
  143. tpp_des = 'teleport with glue',
  144. ro_des = 'removes all objects',
  145. meep_des = 'gives meep',
  146. ban_des = 'disables commands for <name>',
  147. unban_des = 'enables commands for <name>',
  148. admin_des = 'gives admin rank',
  149. unadmin_des = 'withdraws admin rank',
  150. score_des = 'sets <player> score',
  151. mapname_des = 'changes map name',
  152. shamname_des = 'changes shaman name',
  153. respawn_des = 'respawns',
  154. autorespawn_des = 'on/off autorespawn',
  155. color_des = 'sets nickname color',
  156. queue_des = 'on/off maps queuing',
  157. maps_des = 'shows maps queue',
  158. np_des = 'plays map',
  159. npp_des = 'adds map to queue',
  160. mort_des = 'kill yourself',
  161. off_des = 'disables command',
  162. on_des = 'enables command',
  163. cmd_des = 'shows commands list',
  164. pet_des = 'converts <name> into pet',
  165. unpet = 'withdraws !pet',
  166. set_des = 'shows settings lists',
  167. xml_des = 'plays map from xml code',
  168. house_des = 'sets tribe house',
  169. help_des = 'shows help',
  170. vampire_des = 'turns into vampire',
  171. log_des = 'shows !commands log',
  172. queue_set = 'maps queuing',
  173. autorespawn_set = 'auto respwan',
  174. autoTimeLeft_set = 'automatic time change',
  175. afk_set = 'AFK death',
  176. autoNewGame_set = 'auto map change',
  177. autoScore_set = 'auto score',
  178. autoShaman_set = 'automatic selection of Shaman',
  179. shamanSkills_set = 'shaman skills',
  180. settime_des = 'sets game time',
  181. snow_des = 'toggles snow',
  182. _des = '',
  183. _des = '',
  184. _des = '',
  185.  
  186. }
  187. lang.pl = {
  188. help = [[<p align="center"><font size="19px">Ultimate Tribe House Script</font> v. ]]..version..[[</p><p align="right"><font size="10px" color="#ffffff">created by Szel</font></p>Komendy:
  189. !cmd - wszystkie komendy
  190. !set - ustawienia
  191. !help - pomoc
  192. Skróty klawiszowe:
  193. h - help
  194. Esc - zamyka okna
  195. i - komendy
  196. o - opcje
  197. m - minigry
  198. ]],
  199. disabled = 'wylaczone',
  200. enabled = 'wlaczone',
  201. disable = 'wylacz',
  202. enable = 'wlacz ',
  203. refresh = 'odswiez',
  204. close = 'zamknij',
  205. minigame = 'Minigra',
  206. minigames = 'Minigry',
  207. module_stop = '!module stop - zeby wylaczyc minigre',
  208.  
  209. maps_queue = 'Kolejka map',
  210. queuing = 'Kolejkowanie',
  211. played = 'Zagrano',
  212. maps2 = 'map',
  213. delete = 'usun',
  214. admins = 'Admini',
  215. reset_settings = 'resetuj ustawienia',
  216. settings = 'Ustawienia',
  217. commands = 'Komendy',
  218. for_admins = 'dla adminów',
  219. banned = 'Masz bana',
  220. a = '',
  221. a = '',
  222.  
  223. module_des = 'wlacza minigre',
  224. made_des = 'nowa komenda',
  225. kill_des = 'zabija',
  226. ice_des = 'zamraza',
  227. sham_des = 'daje szamana',
  228. ch_des = 'daje ser',
  229. tp_des = 'teleportuje',
  230. utp_des = 'wylacza teleportacje, [odkleja gracza]',
  231. tpp_des = 'teleportuje i przykleja',
  232. ro_des = 'usuwa wszystkie objekty',
  233. meep_des = 'daje meep',
  234. ban_des = 'wylacza komendy dla <nick>',
  235. unban_des = 'wlacza komendy dla <nick>',
  236. admin_des = 'daje admina',
  237. unadmin_des = 'zabiera admina',
  238. score_des = 'ustawia wynik',
  239. mapname_des = 'zmienia nazwe mapy',
  240. shamname_des = 'zmienia nazwe szamana',
  241. respawn_des = 'odradza',
  242. autorespawn_des = 'wlacza/wylacza automatyczne odradzanie',
  243. datl_des = 'wlacza/wylacza czas',
  244. color_des = 'Ustawia kolor nicka',
  245. queue_des = 'wlacza/wylacza kolejkowanie map',
  246. maps_des = 'pokazuje kolejke map',
  247. np_des = 'wlacza mape',
  248. npp_des = 'dodaje mape do kolejki',
  249. mort_des = 'zabija gracza',
  250. off_des = 'wylacza komende',
  251. on_des = 'wlacza komende',
  252. cmd_des = 'pokazuje spis komend',
  253. pet_des = 'zamienia <arg1> w zwierzatko',
  254. unpet = 'wylacza !pet',
  255. set_des = 'pokazuje ustawienia',
  256. xml_des = 'laduje mape z kodu XML',
  257. house_des = 'ustawia chatke plemienna',
  258. help_des = 'pomoc',
  259. vampire_des = 'zamienia w wampira',
  260. log_des = 'pokazuje log !komend',
  261. queue_set = 'kolejkowanie map',
  262. autorespawn_set = 'automatyczne odradzanie',
  263. autoTimeLeft_set = 'autoTimeLeft',
  264. afk_set = 'smierec AFK',
  265. autoNewGame_set = 'automatyczna zmiana map',
  266. autoScore_set = 'automatyczne punkty',
  267. autoShaman_set = 'atomatyczne wybieranie szamana',
  268. shamanSkills_set = 'dodatkowe umiejetnosci szamana',
  269. settime_des = 'ustaw czas',
  270. snow_des = 'wlacza snieg',
  271. _des = '',
  272. _des = '',
  273. _des = '',
  274.  
  275. }
  276. lg = lang[language]
  277. mapNumber = 0
  278. wait = 0
  279. Log = '\n'
  280. tp = {}
  281. tpp = {}
  282. playerPosition = {}
  283. ban = {}
  284. maps = {}
  285. ob = {}
  286. timer = {}
  287. pet = {}
  288. move = {}
  289. xml = {}
  290. vote = {}
  291.  
  292. commands = {
  293. kill = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.kill_des, func = function(nick, args)
  294. tfm.exec.killPlayer(name(1))
  295. end},
  296. ice = {on = 1, admin = 1, arg = 1, des = lg.ice_des, func = function(nick, args)
  297. if tfm.get.room.playerList[args[2]] then
  298. local y = tfm.get.room.playerList[args[2]].y
  299. local x = tfm.get.room.playerList[args[2]].x
  300. tfm.exec.addShamanObject(54, x, y, 0, 0, 0, false)
  301. tfm.exec.killPlayer(args[2])
  302. end
  303. end},
  304. sham = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.sham_des, func = function(nick, args)
  305. tfm.exec.setShaman(name(1))
  306. end},
  307. ch = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.ch_des, func = function(nick, args)
  308. tfm.exec.giveCheese(name(1))
  309. end},
  310. tp = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.tp_des, func = function(nick, args)
  311. system.bindMouse(nick,true)
  312. tpp[nick] = nil
  313. tp[nick] = args[2]
  314. end},
  315. tpp = {on = 1, admin = 1, arg = 0, arg = 1, des = lg.tpp_des, func = function(nick, args)
  316. system.bindMouse(nick,true)
  317. tp[nick] = nil
  318. tpp[nick] = args[2]
  319. end},
  320. utp = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.utp_des, func = function(nick, args)
  321. playerPosition[name(1)] = nil
  322. tpp[nick] = nil
  323. tp[nick] = nil
  324. playerPosition[nick] = nil
  325. end},
  326. ro = {on = 1, admin = 1, arg = 0, des = lg.ro_des, func = function(nick, args)
  327. for key,val in pairs(tfm.get.room.objectList) do
  328. table.insert(ob, key)
  329. end
  330. for key,val in pairs(ob) do
  331. tfm.exec.removeObject(val)
  332. end
  333. ob = {}
  334. end},
  335. meep = {on = 1, admin = 1, arg = 1, des = lg.meep_des, func = function(nick, args)
  336. tfm.exec.giveMeep(args[2])
  337. end},
  338. ban = {on = 1, admin = 1, arg = 1, des = lg.ban_des, func = function(nick, args)
  339. ban[args[2]] = true
  340. end},
  341. unban = {on = 1, admin = 1, arg = 1, des = lg.unban_des, func = function(nick, args)
  342. ban[args[2]] = false
  343. end},
  344. admin = {on = 1, admin = 1, arg = 1, des = lg.admin_des, func = function(nick, args)
  345. table.insert(admins, args[2])
  346. end},
  347. unadmin = {on = 1, admin = 2, arg = 1, des = lg.unadmin_des, func = function(nick, args)
  348. for i=1,#admins,1 do
  349. if admins[i] == args[2] then
  350. table.remove(admins, i)
  351. end
  352. end
  353. end},
  354. score = {on = 1, admin = 1, arg = 1, arg2 = 2, des = lg.score_des, func = function(nick, args)
  355. tfm.exec.setPlayerScore(args[2], args[3], 0)
  356. end},
  357. mapname = {on = 1, admin = 1, arg = -1, des = lg.mapname_des, func = function(nick, args)
  358. tfm.exec.setUIMapName(bbcode(rest))
  359. end},
  360. shamname = {on = 1, admin = 1, arg = -1, des = lg.shamname_des, func = function(nick, args)
  361. tfm.exec.setUIShamanName(bbcode(rest))
  362. end},
  363. respawn = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.respawn_des, func = function(nick, args)
  364. tfm.exec.respawnPlayer(name(1))
  365. end},
  366. autorespawn = {on = 1, admin = 1, arg = 1, des = lg.autorespawn_des, func = function(nick, args)
  367. if args[2] == 'off' then
  368. settings.autorespawn.on = 0
  369. else
  370. settings.autorespawn.on = 1
  371. end
  372. end},
  373. color = {on = 1, admin = 1, arg = 1, arg = 2, des = lg.color_des, func = function(nick, args)
  374. tfm.exec.setNameColor(args[2],'0x'..args[3])
  375. end},
  376. queue = {on = 1, admin = 1, arg = 1, des = lg.queue_des, func = function(nick, args)
  377. if args[2] == 'off' then
  378. settings.queue.on = 0
  379. tfm.exec.disableAutoNewGame(false)
  380. else
  381. settings.queue.on = 1
  382. tfm.exec.disableAutoNewGame(true)
  383. message('all', 'Wlaczono kolejkowanie', 'green')
  384. end
  385. end},
  386. maps = {on = 1, admin = 0, arg = 0, des = lg.maps_des, func = function(nick, args)
  387. showQueue(nick)
  388. end},
  389. np = {on = 1, admin = 0, arg = 1, des = lg.np_des, func = function(nick, args)
  390. tfm.exec.newGame(args[2])
  391. end},
  392. npp = {on = 1, admin = 0, arg = 1, des = lg.npp_des, func = function(nick, args)
  393. if #maps - mapNumber == 17 then
  394. message(nick, 'Nie mozesz dodac wiecej map', 'red')
  395. else
  396. local code = args[2]
  397. if args[2] == 'xml' then
  398. if not xml[nick] then
  399. return false
  400. end
  401. code = xml[nick].xml
  402. end
  403. local mapNr = #maps+1;
  404. maps[mapNr] = {}
  405. maps[mapNr].code = code
  406. maps[mapNr].name = args[2]
  407. maps[mapNr].nick = nick
  408. end
  409. end},
  410. meep = {on = 1, admin = 0, arg = 0, des = lg.meep_des, func = function(nick, args)
  411. tfm.exec.giveMeep(nick)
  412. end},
  413. mort = {on = 1, admin = 0, arg = 0, des = lg.mort_des, func = function(nick, args)
  414. tfm.exec.killPlayer(nick)
  415. end},
  416. off = {on = 1, admin = 1, arg = 1, des = lg.off_des, func = function(nick, args)
  417. if args[2] == 'off' or args[2] == 'on' then
  418.  
  419. elseif not commands[args[2]] then
  420. message(nick, 'Nie ma takiej komendy', 'red')
  421. else
  422. commands[args[2]].on = 0
  423. message(nick, 'Wylaczono "'..args[2]..'"', 'green')
  424. end
  425. end},
  426. on = {on = 1, admin = 1, arg = 1, des = lg.on_des, func = function(nick, args)
  427. if not commands[args[2]] then
  428. message(nick, 'Nie ma takiej komendy', 'red')
  429. else
  430. commands[args[2]].on = 1
  431. message(nick, 'Wlaczono "'..args[2]..'"', 'green')
  432. end
  433. end},
  434. cmd = {on = 1, admin = 0, arg = 0, des = lg.cmd_des, func = function(nick, args)
  435. showCmd(nick)
  436. end},
  437. pet = {on = 1, admin = 1, arg = 1, des = lg.pet_des, func = function(nick, args)
  438. pet[args[2]] = nick
  439. end},
  440. unpet = {on = 1, admin = 1, arg = 1, des = lg.unpet,func = function(nick, args)
  441. pet[args[2]] = nil
  442. end},
  443. set = {on = 1, admin = 0, arg = 0, des = lg.set_des, func = function(nick, args)
  444. options(nick)
  445. end},
  446. xml = {on = 1, admin = 0, arg = -1, des = lg.xml_des, func = function(nick, args)
  447. if args[2] == 'start' then
  448. xml[nick] = {}
  449. xml[nick].f = 1
  450. xml[nick].xml = ' '
  451. elseif args[2] == 'play' then
  452. if xml[nick] ~= nil then
  453. tfm.exec.newGame(xml[nick].xml)
  454. end
  455. elseif xml[nick] ~= nil then
  456. if xml[nick].f == 1 then
  457. xml[nick].xml = string.gsub(rest, "&lt;", "<")
  458. xml[nick].f = 0
  459. else
  460. xml[nick].xml = xml[nick].xml..string.gsub(rest, "&lt;", "<")
  461. end
  462. end
  463. end},
  464. house = {on = 1, admin = 0, arg = 1, des = lg.house_des, func = function(nick, args)
  465. if args[2] == 'off' then
  466. house = nil
  467. tfm.exec.disableAfkDeath(false)
  468. tfm.exec.disableAutoShaman(false)
  469. tfm.exec.disableAutoNewGame(false)
  470. else
  471. tfm.exec.disableAfkDeath(true)
  472. tfm.exec.disableAutoShaman(true)
  473. tfm.exec.disableAutoNewGame(true)
  474.  
  475. if args[2] == 'xml' then
  476. house = xml[nick]
  477. tfm.exec.newGame(xml[nick])
  478. else
  479. house = args[2]
  480. tfm.exec.newGame(args[2])
  481. end
  482.  
  483. end
  484. end},
  485. help = {on = 1, admin = 0, arg = 0, des = lg.help_des, func = function(nick, args)
  486. showHelp(nick)
  487. end},
  488. vampire = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.vampire_des, func = function(nick, args)
  489. tfm.exec.setVampirePlayer(name(1))
  490. end},
  491. log = {on = 1, admin = 2, arg = 0, arg2 = 0, des = lg.log_des, func = function(nick, args)
  492. ui.addTextArea(3, Log:sub(1, 2000), nick, 250, 40, 300, 335, nil, nil,0.7)
  493. end},
  494. module = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.module_des, func = function(nick, args)
  495. if not args[2] then
  496. showModules(nick)
  497. elseif module.on == 1 and (args[2] == 'stop' or args[2] == 'off')and isAdmin(nick) then
  498. if modules[module.play].off then
  499. modules[module.play]:off(args)
  500. end
  501. module.on = 0
  502. module.play = ''
  503. elseif isAdmin(nick) and modules[args[2]] then
  504. modulePlay(nick, args[2])
  505. end
  506. end},
  507. settime = {on = 1, admin = 1, arg = 1, des = lg.settime_des, func = function(nick, args)
  508. tfm.exec.setGameTime(args[2])
  509. end},
  510. snow = {on = 1, admin = 1, arg = 0, des = lg.snow_des, func = function(nick, args)
  511. tfm.exec.snow()
  512. end},
  513.  
  514. -- own commands / wlasne komendy
  515.  
  516.  
  517.  
  518. -- end of own commands / koniec wlasnych komend
  519. }
  520.  
  521. settings = {
  522. queue = {on = 0, def = 0,
  523. des = lg.queue_set,
  524. fOn = function() end,
  525. fOff = function() end},
  526. autorespawn = {on = 0, def = 0,
  527. des = lg.autorespawn_set,
  528. fOn = function() end,
  529. fOff = function() end},
  530. autoTimeLeft = {on = 0, def = 0,
  531. des = lg.autoTimeLeft_set,
  532. fOn = function() tfm.exec.disableAutoTimeLeft(false) end,
  533. fOff = function() tfm.exec.disableAutoTimeLeft(true) end},
  534. afk = {on = 1, def = 0,
  535. des = lg.afk_set,
  536. fOn = function() tfm.exec.disableAfkDeath(false) end,
  537. fOff = function() tfm.exec.disableAfkDeath(true) end},
  538. autoNewGame = {on = 1, def = 1,
  539. des = lg.autoNewGame_set,
  540. fOn = function() tfm.exec.disableAutoNewGame(false) end,
  541. fOff = function() tfm.exec.disableAutoNewGame(true) end},
  542. autoScore = {on = 1, def = 1,
  543. des = lg.autoScore_set,
  544. fOn = function() tfm.exec.disableAutoScore(false) end,
  545. fOff = function() tfm.exec.disableAutoScore(true) end},
  546. autoShaman = {on = 1, def = 1,
  547. des = lg.autoShaman_set,
  548. fOn = function() tfm.exec.disableAutoShaman(false) end,
  549. fOff = function() tfm.exec.disableAutoShaman(true) end},
  550. shamanSkills = {on = 1, def = 1,
  551. des = lg.shamanSkills_set,
  552. fOn = function() tfm.exec.disableAllShamanSkills(false) end,
  553. fOff = function() tfm.exec.disableAllShamanSkills(true) end},
  554. -- own settings / wlasne ustawienia
  555.  
  556.  
  557.  
  558. -- end of own settings / koniec wlasnych ustawien
  559. }
  560.  
  561. -- moduly
  562. module = {on = 0, play = ''}
  563. modules = {
  564. racing = {name = 'Racing', maps = {3078,8679,82090,127419,129835,142101,142738,146364,146615,147437,149853,153201,155415,159076,159204,162804,164931,165808,169033,169909,178486,179656,180035,180617,181261,182233,185646,185955,185985,186484,186695,191070,197413,197442,197503,197742,199957,201502,201606,210217,211248,212576,212903,213470,214465,214788,215601,219889,220737,221767,222730,228517,233294,233333,235464,237251,238378,240994,244642,245152,247329,247904,248906,250491,250619,261462,266889,269131,269534,270645,274963,276098,280637,281784,284702,286087,292057,294500,298123,302456,303391,306755,313182,318970,321268,327447,329627,335361,337813,352622,353079,363635,364490,366205,369138,371072,371332,387110,402190,405795,417816,421885,422655,423989,424864,429339,433483,446627,446819,455094,466871,470069,482003,500133,505196,511007,520258,523865,547602,552213,557334,581408,611234,629731,639804,659216,667934,724780,763961,780286,847540,1053516,1107804,1190826,1193625,1222017,1222509,1252255,1368022,1429444,1481024,1502799,1550076,1556972,1563226,1662570,1683790,1698845,1699288,1855968,1864676,1931963,1943359,1958341,1970001,2006183,2019746,2188104,2208335,2223354,2227644,2261303,2262297,2311047,2355739,2378818,2419958,2439335,2444362,2458243,2558294,2589845,2598599,2616341,2675699,2708773,2746128,2805602,2808729,2813218,2827176,2842279,2847966,2870002,2929597,2932980,2959762,2959999,2960917,2969368,2972400,2973921,2978151,3008536,3014728,3051957,3117749,3124326,3124696,3224383,3237735,3270188,3279863,3297112,3314017,3373223,3407209,3425103,3432133,3452208,3464359,3469357,3497411,3512325,3526384,3560912,3586018,3603116,3605217,3671328,3710926,3714605,3723142,3779546,3865524,3866374,4116927,4140588,4148686,2283,2806,3154,72339,103182,107544,112790,114122,117548,120152,122911,124359,130763,136966,138036,138678,140850,144468,144677,145020,145762,146801,147436,148424,150692,152299,155168,156685,156847,157590,158128,159351,160762,161730,163682,164802,165112,165747,165843,166705,167941,168776,169065,169892,171152,176263,177236,177813,178545,178657,179339,179541,180191,180255,180274,180469,180509,180619,181312,184110,184924,185760,185774,186604,190026,191201,191716,191749,191753,192391,192566,193009,193588,193936,195720,196433,196468,196574,197219,197501,198549,198715,199219,201323,201442,206810,208058,208162,208914,209315,209708,209799,210188,211041,211528,211565,211885,212542,213331,213697,213933,214037,214660,214775,215938,216439,216505,216553,216735,217282,217881,217900,219548,220500,221564,222098,223293,223810,223986,224441,225017,226069,226879,226883,227417,227851,228462,229814,229827,229830,229834,229835,229944,230510,230741,231254,231694,231905,232140,232274,232451,232699,232791,233230,233345,233398,233687,234039,234502,234959,235034,235501,235651,236146,237000,237041,237263,237269,237278,237281,237297,237321,237744,237759,238380,238791,239826,239880,240544,240548,240973,241211,241295,242708,243279,244006,244699,244888,245223,246790,246973,247815,247818,248098,250610,250634,251459,252033,252759,252806,253883,254291,255098,255542,255893,258717,259604,259716,259833,260024,260292,260338,260377,260384,260478,260678,261078,261172,261720,261959,262144,262212,262239,263163,263182,263624,263907,264132,264232,264348,265221,266704,266765,266807,266854,266913,266930,267187,267597,268985,269337,270668,270819,271523,273434,274321,275017,275514,277687,277784,278506,278916,279100,279256,280382,280896,281730,282101,282434,282694,283526,283715,283874,284299,285752,286333,287268,289821,291628,292348,292614,293065,294522,294943,299002,299503,299971,300055,301315,302936,304356,305677,306213,308280,308435,308694,308711,308729,308992,309029,309057,309169,309834,312713,313245,314159,314205,315801,316289,317696,317754,317779,318378,318813,319524,319841,321339,321712,321814,321906,322771,323085,323115,323366,323600,324355,325172,326032,326192,326585,327254,327266,330441,332210,332290,332467,333277,333656,333714,333837,335507,337581,337774,339272,339418,339643,339896,340069,340901,341116,341239,343048,344361,344865,344952,345257,345312,345943,348479,348801,349140,349389,349984,350251,350519,352381,352710,352885,354616,354878,355658,355676,355769,355957,356722,356982,357328,357428,357629,359055,359521,359901,360201,360271,360273,360365,361382,361852,362549,363411,363625,363638,363822,364186,364998,365315,365464,365652,365774,367520,369160,369230,370444,370850,371076,371078,372970,373511,375381,378826,379326,379550,379745,379866,381043,381287,381305,381569,381669,382977,384206,384869,385203,385295,386029,386046,386959,387012,387180,387270,387290,387638,389582,391625,391693,391831,391868,391990,392446,392492,392913,393675,393851,394890,395459,395585,395607,395638,396223,396332,396347,396645,396861,397093,397296,397501,397812,397938,398011,398041,398081,398942,399633,399673,400429,400666,401443,401778,401945,401995,402214,402239,402453,402936,403698,403910,404440,404590,405075,405295,405339,405497,405679,405833,405955,406266,406486,406881,406982,407165,407230,407294,407455,407457,407488,407495,407536,407686,407746,408978,409199,410230,410532,410565,410608,410736,410813,412211,412316,412657,412752,413408,414188,414460,414899,416015,416142,416552,418022,418196,418265,418293,418323,418337,418600,418606,418658,419374,419735,420806,420956,421302,421717,422361,422580,422939,423062,423449,423517,423672,424361,424786,424795,425030,425044,425215,425349,425548,425600,425771,425797,425806,426638,427300,428517,429262,429822,429897,430145,430219,430736,431142,431373,431887,433937,434887,436041,436107,436447,437860,438154,440676,441047,441376,441598,443309,444490,444830,444964,445133,445219,447556,448281,453701,455167,459349,463195,463977,465205,468260,470687,470727,471053,472379,472665,475151,475790,477370,477603,480023,482951,483924,484992,494706,496091,496945,499109,499682,499684,499687,500074,501428,501711,501916,504409,504461,504704,504951,505109,505963,506215,507308,507325,508106,508451,509047,509082,510194,511187,511275,512291,512927,514510,514982,517005,517697,523046,528428,531569,536235,537776,538116,545493,549470,551126,556253,556426,558790,563183,563484,564033,566347,566438,571144,580031,583056,583715,586622,586688,587458,590641,592204,594049,594883,595447,603381,606719,606723,608459,610137,611320,613985,616373,616433,620996,624098,624721,627609,634945,639649,645288,646968,658464,664949,667920,669031,670226,694900,704015,734476,737824,737841,749102,759128,763371,763378,789058,792062,798953,813156,824082,829657,838069,846805,849224,879616,905496,972616,976721,976786,979179,982242,996947,1015436,1015582,1019378,1033170,1034035,1051378,1051384,1058681,1085530,1102815,1130728,1132357,1132639,1142116,1143815,1144548,1162611,1167153,1167734,1172426,1174107,1195842,1208798,1208979,1210037,1214182,1216253,1221661,1222899,1229246,1231216,1234914,1249601,1252122,1253523,1255130,1255148,1256845,1262248,1281700,1281981,1286910,1307880,1311059,1321417,1321664,1341396,1346440,1351308,1352534,1358446,1359797,1364063,1368222,1368233,1371239,1371294,1372941,1373000,1373748,1375345,1378209,1393405,1394120,1398732,1404417,1405249,1405496,1416040,1425101,1428436,1445160,1448760,1450554,1453667,1471124,1483155,1487161,1490438,1491022,1492120,1495344,1503393,1504586,1506007,1509474,1512355,1513407,1525272,1531388,1538895,1539515,1539791,1542618,1542736,1555532,1555862,1556661,1564762,1567620,1573213,1573997,1580508,1583655,1586439,1587904,1588884,1589026,1591471,1592767,1595600,1595610,1597594,1600443,1601492,1601786,1601857,1602654,1603050,1605364,1608259,1608638,1609978,1611631,1612436,1612796,1613550,1613927,1614563,1618110,1619934,1621611,1622737,1623300,1628732,1629164,1632294,1632541,1632706,1632746,1634741,1637638,1639996,1643157,1644638,1646120,1648583,1651658,1654096,1654105,1654841,1654903,1657021,1657360,1658171,1659639,1659716,1661852,1663380,1663415,1665249,1665516,1665775,1669046,1673174,1674534,1675083,1678717,1687268,1689382,1692628,1693705,1694602,1703617,1705316,1716693,1716949,1718723,1724289,1728943,1749434,1751944,1759287,1768347,1778687,1787232,1787239,1794287,1802907,1841744,1845710,1848032,1851411,1851568,1851968,1856349,1862800,1862823,1873736,1923785,1924227,1926831,1927270,1932796,1951856,1952851,1954369,1954898,1956002,1956555,1964700,1964752,1965819,1973574,1975275,1975286,1975684,1975753,1976007,1976857,1979131,1982476,1985019,1987990,2005559,2007170,2007205,2007295,2012147,2018511,2023552,2030343,2046467,2047177,2048474,2068543,2070768,2076632,2079190,2089069,2098621,2101747,2106576,2118599,2134537,2138401,2139408,2141379,2144010,2149382,2150335,2174319,2176620,2180790,2185089,2194041,2214661,2219308,2223685,2228834,2245005,2255210,2262476,2286056,2287914,2331474,2347666,2372538,2378820,2393139,2417713,2424058,2453022,2509175,2527934,2536577,2538131,2546484,2557885,2564883,2577060,2580114,2582610,2586491,2588032,2617003,2645615,2682985,2683170,2686505,2725924,2726034,2794075,2796001,2813487,2816067,2840770,2854246,2868414,2883986,2894072,2928081,2953315,2981609,2988325,2989266,2991507,2992312,3008155,3026533,3029580,3036416,3120368,3123384,3142015,3156569,3175920,3203738,3209087,3213562,3249833,3267620,3347209,3408247,3444803,3447108,3453351,3469987,3504036,3517347,3518418,3535192,3537419,3544895,3548376,3548378,3548406,3549484,3549627,3549840,3556405,3556489,3556690,3572407,3574927,3575034,3575108,3575170,3575216,3575293,3575425,3575463,3579335,3579476,3582577,3584275,3584689,3592471,3594130,3595900,3603799,3603802,3603809,3604799,3607846,3611885,3613029,3617674,3620542,3630433,3631748,3637041,3638794,3639993,3644272,3652003,3652102,3654416,3662698,3667358,3668754,3669358,3670084,3674997,3676141,3676555,3679397,3679666,3679884,3680180,3680220,3680221,3680223,3682405,3683201,3683224,3683294,3683383,3683393,3683520,3683600,3684229,3684455,3684457,3684465,3684784,3684802,3685352,3685382,3685486,3688419,3690578,3691609,3691622,3693822,3696662,3700155,3700684,3702767,3705931,3706599,3712183,3716560,3721990,3727755,3728013,3737576,3738767,3778389,3799507,3799857,3799951,3801780,3816622,3818249,3821104,3832217,3834905,3845214,3847244,3854268,3857914,3877599,3889414,3901403,3909339,3912540,3931290,3946626,3948683,3953320,3953425,3967150,3967250,3970909,3974317,3984750,3985806,3986301,3988460,3992276,3992671,3994471,3999981,4003729,4024450,4029729,4035194,4049042,4059294,4088014,4088129,4091580,4103460,4119705,4142205,4146225,4148332,4174318,4174320,4212491,4229660,4230149,4234534,4238784,4271298,4323335,4337892,4338921},
  565. help = [[
  566. !mode normal/drunk
  567. ]],
  568. func = function(self)
  569. self.mode = 'normal'
  570. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  571. tfm.exec.disableAutoNewGame(true)
  572. tfm.exec.disableAutoShaman(true)
  573. tfm.exec.disableAutoTimeLeft(true)
  574. end,
  575. off = function(self)
  576. tfm.exec.disableAutoNewGame(false)
  577. tfm.exec.disableAutoShaman(true)
  578. tfm.exec.disableAutoTimeLeft(false)
  579. end,
  580. eventLoop = function(self, t1, t2)
  581. if self.mode == 'drunk' then
  582. if math.random(5) == 1 then
  583. for key,val in pairs(tfm.get.room.playerList) do
  584. x = math.random(-50, 50)
  585. if x ~= 0 then
  586. tfm.exec.movePlayer(key, 0, 0, true, math.random(-50, 50), 0, true)
  587. end
  588. end
  589. end
  590. end
  591. if t2<=0 then
  592. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  593. end
  594. end,
  595. eventPlayerWon = function(self, name)
  596. local i=0
  597. for k,v in pairs(tfm.get.room.playerList) do
  598. if not v.isDead then
  599. i=i+1
  600. end
  601. end
  602. if i==0 then
  603. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  604. end
  605. end,
  606. eventPlayerDied = function(self, name)
  607. local i=0
  608. for k,v in pairs(tfm.get.room.playerList) do
  609. if not v.isDead then
  610. i=i+1
  611. end
  612. end
  613. if i==0 then
  614. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  615. end
  616. end,
  617. eventChatCommand = function(self, name, msg)
  618. if msg == 'mode drunk' then
  619. self.mode = 'drunk'
  620. elseif msg == 'mode normal' then
  621. self.mode = 'normal'
  622. end
  623. end,
  624. eventNewGame = function(self)
  625. tfm.exec.setGameTime(63)
  626. end
  627. },
  628. survivor = {name = 'Simple survivor', maps = {276534,279689,280120,280159,281431,281479,281492,281649,289932,289964,290388,290546,290725,290865,290971,290974,291399,291643,292592,292672,292678,293222,293487,295988,296033,299123,300404,302224,304198,304482,305748,305753,306106,306360,306382,307930,311496,390383,390386,390649,390657,391057,391643,391664,391738,392616,392646,393406,395246,397066,459284,464787,478116,479091,481676,489470,489829,490248,492283,495880,500312,521931,540495,573817,697561,741041,770675,787131,793117,797964,799141,802958,802975,803074,811211,848697,852617,866256,908739,937383,958881,1026249,1277941,1388662,1463332,1492805,1514928,1515058,1519483,1522692,1525486,1528388,1533333,1533374,1539148,1543937,1545834,1659906,1661909,1794873,1794907,1812056,2387888,2408376,2526952,2732060,2842113,2931068,2939549,3061252,3067251,3107377,3146721,3175437,3295213,3322939,3349286,3400319,3419948,3473722,3480467,3540608,3549404,3550350,3584123,3584826,3587860,3620709,3670885,3685564,3699989},
  629. func = function(self)
  630. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  631. tfm.exec.disableAutoNewGame(true)
  632. end,
  633. off = function(self)
  634. tfm.exec.disableAutoNewGame(false)
  635. end,
  636. eventLoop = function(self, t1, t2)
  637. if t2<=0 then
  638. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  639. end
  640. end,
  641. eventPlayerDied = function(self, name)
  642. local i=0
  643. for k,v in pairs(tfm.get.room.playerList) do
  644. if not v.isDead then
  645. i=i+1
  646. end
  647. end
  648. if i==0 then
  649. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  650. end
  651. end,
  652. },
  653.  
  654. vampire = {name = 'Vampire survivor', maps = {258972,334445,423793,615791,760329,812007,946893,955523,1296883,1542025,1638989,1676629,1782151,2389613,2393716,2403639,2428213,2429313,2435372,2541364,2561153,2563004,2680717,2683284,2686097,2693083,2761246,2821033,2910904,2929496,2938327,2940045,2944932,2951616,2953590,2956031,2956156,2971085,2975699,2976059,2983430,2986318,2999898,3001393,3006311,3020988,3027934,3032840,3033710,3044452,3057493,3061098,3068111,3069138,3079426,3090849,3101671,3103683,3105156,3110659,3119050,3120924,3128337,3140275,3167932,3170618,3187755,3195331,3197349,3225462,3240230,3270111,3292389,3296041,3333339,3334083,3337200,3359267,3377553,3430472,3435288,3460936,3482009,3485896,3488764,3509662,3515991,3611033,3745155,3745168,3808004,3946003},
  655. func = function(self)
  656. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  657. tfm.exec.disableAutoNewGame(true)
  658. end,
  659. off = function(self)
  660. tfm.exec.disableAutoNewGame(false)
  661. end,
  662. eventLoop = function(self, t1, t2)
  663. if t2<=0 then
  664. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  665. end
  666. local i=0
  667. for k,v in pairs(tfm.get.room.playerList) do
  668. if not v.isDead then
  669. i = i+1
  670. end
  671. end
  672. local x = 0
  673. for k,v in pairs(tfm.get.room.playerList) do
  674. if v.isVampire then
  675. x = x+1
  676. end
  677. end
  678. if i == 0 or x == i then
  679. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  680. end
  681. end,
  682. },
  683. bootcamp = {name = 'Bootcamp', maps = {155517,156510,159116,159145,167333,170007,175454,176615,177652,186855,187035,195453,197368,212322,215933,229974,235717,249760,253469,255943,257092,258289,259854,266398,277631,277835,280949,281668,281985,285589,285961,292668,292808,293658,294478,295487,296020,298424,301559,305680,313138,313214,322922,330590,342640,343875,346684,353356,357837,366809,368585,371579,374995,392861,431873,503679,507341,507884,515684,544695,549759,554154,591528,593003,597348,597804,621850,639878,651656,655207,658960,720672,733146,763368,814311,1102513,1110982,1134969,1296299,1350382,1526368,1533335,1584555,1610638,1636814,1642725,1646448,1657819,1705006,1719709,1737297,1737800,1737914,1766343,1802012,1802528,1828801,1830551,1852910,1853529,1853689,1869912,1872179,1949730,1951944,1952415,1962695,2009003,2031184,2033229,2036898,2050389,2080400,2082776,2128560,2132250,2176211,2202628,2208924,2239788,2242899,2252731,2297260,2309030,2341982,2346943,2357991,2362046,2378364,2395201,2420714,2427910,2432090,2444812,2448730,2466489,2474044,2484316,2574744,2574960,2601214,2636207,2643916,2668918,2669415,2673019,2682583,2692883,2693344,2693587,2704483,2707566,2708585,2718406,2719419,2738370,2747525,2750014,2758747,2772507,2777168,2789121,2797076,2803483,2805938,2811229,2812309,2817711,2818330,2819876,2828481,2844637,2850177,2854813,2858882,2860211,2860683,2869337,2877042,2884392,2887929,2890123,2901717,2914456,2917286,2918822,2920826,2925531,2925762,2933011,2933215,2933390,2941840,2945156,2947140,2961800,2963166,2967631,2974387,2996951,2998268,2999994,3000006,3003490,3008319,3008515,3012178,3012311,3016226,3023941,3024238,3024606,3034308,3041105,3042080,3043779,3053202,3062939,3075090,3076903,3085218,3089270,3099302,3118161,3118286,3133917,3137929,3142783,3146209,3149125,3161324,3163166,3164813,3182006,3182487,3185979,3200001,3219400,3225624,3241030,3242050,3243455,3250426,3264848,3278138,3281758,3292308,3293485,3295954,3295960,3311534,3330219,3337127,3338283,3343092,3343148,3374634,3386996,3395605,3399831,3402881,3404894,3424529,3428069,3430712,3434941,3447134,3459986,3463050,3471016,3473704,3473925,3478040,3483300,3484437,3491601,3493456,3493490,3500755,3513929,3521460,3526517,3527399,3530999,3535850,3547571,3560999,3561333,3571256,3576303,3588395,3603631,3619320,3637540,3645415,3659983,3668877,3690128,3702819,3707630,3725142,3734988,3734989,3734990,3734991,3734996,3734997,3734998,3734999,3745158,3747520,3750360,3759157,3767893,3768117,3779861,3780618,3799357,3804078,3815568,3820467,3820501,3826546,3846632,3849999,3860578,3866660,3866663,3875019,3920916,3937567,3938895,3944386,3944814,3958217,3959785,3964892,3969628,3976725,3976766,3995343,3999991,3999992,3999997,4000007,4000008,4000009,4019421,4027263,4038388,4039451,4058168,4093488,4107909,4121359,4237910,4241333,4283009,113156,124000,149422,149451,150607,150651,150664,151655,152260,152733,153996,155480,155606,155611,155628,155765,156720,157004,157203,157805,157960,158345,158417,158909,159131,159187,159298,159932,160841,161023,161434,162482,163094,163159,163172,163506,163531,163596,164544,164916,165186,166032,166037,166056,166271,166333,166361,166430,166805,167075,167903,168204,168754,169059,169076,169110,169139,169228,170514,171148,171480,171482,171776,172501,172512,172520,172547,172605,172621,172951,172976,173623,173816,174223,175204,175280,176253,176507,176619,176710,176729,179005,179488,179492,179807,180801,182370,182769,183139,183141,184648,184817,184868,185289,185428,185529,185873,185887,186066,186220,186378,189819,190646,190996,191177,191203,191205,191443,191642,192158,192959,193662,195116,197229,198988,199210,199710,199826,201000,202574,203664,204488,204647,205240,205506,206396,208056,208373,208653,208940,209848,213752,213755,213874,214631,214755,216171,216173,217261,220352,222377,222910,223174,223947,224108,225744,226266,230588,231137,231921,232469,232678,235037,236768,237091,250153,254785,257218,257324,257715,258160,258192,258908,259319,261298,261814,263819,263926,264091,268915,270143,270924,271193,271411,272402,272518,272689,277427,277513,277824,279337,281948,282584,284134,286254,289865,290824,295630,295932,297442,299942,299983,301610,302080,303151,303939,304861,305567,305614,305705,305820,306365,306384,306655,307324,313216,314743,315666,315800,316012,318129,319443,320483,320626,322582,327354,327743,329200,329318,329571,330933,330967,331344,331988,332130,332906,333002,336305,337644,342035,343456,354984,361500,365061,368839,372255,372419,373105,375455,376704,378704,380516,383358,391924,392240,393426,394132,395216,395310,395961,397467,397469,397478,398116,399364,401630,403755,403940,406154,408577,408643,410040,410045,412467,412913,419335,419369,419635,420877,422981,423311,424604,424685,424900,425747,425884,431433,431749,432501,435812,438333,438364,438449,439092,444589,447805,449496,454049,455271,457726,458528,460961,467137,476706,478236,482791,492222,492399,496610,496886,497965,499986,500000,500690,500748,500894,504485,505619,506032,506613,506940,510996,511136,512887,514311,522719,523270,528032,531084,536905,541223,541693,541729,543010,551317,552986,556575,556841,556973,557066,557074,560526,560583,562897,563436,564198,568122,571683,574183,575497,584783,586901,587501,592189,593164,593204,593431,593530,596239,598845,605255,608368,612415,618999,654894,684566,692650,692740,698992,721319,722837,729863,758595,783547,801683,815336,834297,842019,842167,868262,881158,898934,912356,914570,919484,970919,976944,999963,1000006,1004622,1014313,1018394,1046877,1066607,1111252,1130256,1156092,1157281,1162831,1164086,1226207,1242584,1255359,1256085,1265789,1301649,1303323,1323048,1333846,1383297,1384078,1390405,1398609,1403454,1410539,1413528,1427980,1435902,1494499,1503203,1526894,1531604,1540221,1580356,1580835,1593066,1595965,1615753,1615949,1620703,1647131,1678634,1722755,1733211,1788490,1807217,1809410,1923584,1955745,1989803,1990413,2024960,2040569,2130169,2178800,2311703,2329940,2416969,2423300,2451444,2469365,2520540,2636519,2788517,2794566,2795201,2846829,2989803,3038589,3136410,3199998,3242049,3295967,3326197,3333223,3380788,3456260,3551333,3668866,3668888,3690269,3907267,3908151,3988424,4067327,4074214},
  684. help = [[
  685. !s or !ss to save position
  686. !l or l key to load
  687. !new to new map
  688. ]],
  689. func = function(self)
  690. self.save = {}
  691. for k,v in pairs(tfm.get.room.playerList) do
  692. eventNewPlayer(k)
  693. end
  694. system.disableChatCommandDisplay('ss', true)
  695. system.disableChatCommandDisplay('s', true)
  696. system.disableChatCommandDisplay('l', true)
  697. tfm.exec.disableAutoShaman(true)
  698. tfm.exec.disableAutoNewGame(true)
  699. tfm.exec.disableAutoTimeLeft(true)
  700. tfm.exec.disableAfkDeath(true)
  701. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  702. end,
  703. off = function(self)
  704. tfm.exec.disableAutoShaman(false)
  705. tfm.exec.disableAutoNewGame(false)
  706. tfm.exec.disableAutoTimeLeft(false)
  707. tfm.exec.disableAfkDeath(false)
  708. system.disableChatCommandDisplay('ss', false)
  709. system.disableChatCommandDisplay('s', false)
  710. system.disableChatCommandDisplay('l', false)
  711. end,
  712. eventLoop = function(self, t1, t2)
  713. if t2<=0 then
  714. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  715. end
  716. end,
  717. eventPlayerDied = function(self, name)
  718. tfm.exec.respawnPlayer(name)
  719. end,
  720. eventPlayerWon = function(self, name)
  721. tfm.exec.respawnPlayer(name)
  722. end,
  723. eventNewPlayer = function(self, name)
  724. tfm.exec.respawnPlayer(name)
  725. tfm.exec.bindKeyboard(name,76,true,true)
  726. end,
  727. eventNewGame = function(self)
  728. tfm.exec.setGameTime(300)
  729. self.save = {}
  730. end,
  731. eventChatCommand = function(self, name, msg)
  732. if msg == 's' or msg == 'ss' then
  733. if not self.save[name] then
  734. self.save[name] ={}
  735. end
  736. self.save[name].x = tfm.get.room.playerList[name].x
  737. self.save[name].y = tfm.get.room.playerList[name].y
  738. self.save[name].cheese = tfm.get.room.playerList[name].hasCheese
  739. elseif msg == 'l' then
  740. if self.save[name] then
  741. tfm.exec.movePlayer(name, self.save[name].x, self.save[name].y)
  742. if self.save[name].cheese then
  743. tfm.exec.giveCheese(name)
  744. end
  745. end
  746. elseif msg == 'next' then
  747. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  748. end
  749. end,
  750. eventKeyboard = function(self, name, key, down, x, y)
  751. if key == 76 then
  752. if self.save[name] then
  753. tfm.exec.movePlayer(name, self.save[name].x, self.save[name].y, false, 1, 1)
  754. if self.save[name].cheese then
  755. tfm.exec.giveCheese(name)
  756. end
  757. end
  758. end
  759. end,
  760. },
  761. ffa = {name = 'Free for all', author = 'Shamousey', maps={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},
  762. func = function(self)
  763. tfm.exec.disableAutoNewGame(true)
  764. tfm.exec.disableAutoShaman(true)
  765. self.players={}
  766. self.toDespawn={}
  767. for name,player in pairs(tfm.get.room.playerList) do
  768. eventNewPlayer(name)
  769. end
  770.  
  771. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  772. end,
  773. off = function(self)
  774. tfm.exec.disableAutoNewGame(false)
  775. tfm.exec.disableAutoShaman(false)
  776. tfm.exec.newGame()
  777. end,
  778. eventNewPlayer = function(self, name)
  779. for i,key in pairs({32,40,83}) do
  780. tfm.exec.bindKeyboard(name,key,true,true)
  781. end
  782. self.players[name]={
  783. timestamp=os.time(),
  784. offsets={x=2, y=10}
  785. }
  786. end,
  787. eventKeyboard = function(self, name,key,down,x,y)
  788. if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and self.started then
  789. if self.players[name].timestamp < os.time()-1000 then
  790. local id
  791. if tfm.get.room.playerList[name].isFacingRight then
  792. id=tfm.exec.addShamanObject(19,x+self.players[name].offsets.x,y+self.players[name].offsets.y)
  793. else
  794. id=tfm.exec.addShamanObject(20,x+self.players[name].offsets.x,y+self.players[name].offsets.y)
  795. end
  796. self.players[name].timestamp=os.time()
  797. table.insert(self.toDespawn,{os.time(),id})
  798. end
  799. end
  800. end,
  801. eventNewGame = function(self)
  802. self.started=false
  803. end,
  804. eventLoop = function (self, t1,t2)
  805. if t1 >= 3000 and not started then
  806. self.started=true
  807. end
  808. if t2<=0 then
  809. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  810. end
  811. for i,cannon in ipairs(self.toDespawn) do
  812. if cannon[1] <= os.time()-3000 then
  813. tfm.exec.removeObject(cannon[2])
  814. table.remove(self.toDespawn,i)
  815. end
  816. end
  817. end,
  818. eventPlayerDied = function(self, name)
  819. local i=0
  820. local n
  821. for pname,player in pairs(tfm.get.room.playerList) do
  822. if not player.isDead then
  823. i=i+1
  824. n=pname
  825. end
  826. end
  827. if i==0 then
  828. tfm.exec.newGame(self.maps[math.random(#self.maps)])
  829. elseif i==1 then
  830. tfm.exec.giveCheese(n)
  831. tfm.exec.playerVictory(n)
  832. tfm.exec.setGameTime(5)
  833. end
  834. end,
  835. },
  836. -- own modulese / wlasne moduly
  837.  
  838.  
  839.  
  840. -- end of own modulese / koniec wlasnych modulów
  841. }
  842.  
  843. ---- sortowanie tablic (skopiowane)
  844. function spairs(t, order)
  845. -- collect the keys
  846. local keys = {}
  847. for k in pairs(t) do keys[#keys+1] = k end
  848. -- if order function given, sort by it by passing the table and keys a, b,
  849. -- otherwise just sort the keys
  850. if order then
  851. table.sort(keys, function(a,b) return order(t, a, b) end)
  852. else
  853. table.sort(keys)
  854. end
  855. -- return the iterator function
  856. local i = 0
  857. return function()
  858. i = i + 1
  859. if keys[i] then
  860. return keys[i], t[keys[i]]
  861. end
  862. end
  863. end
  864.  
  865. -- sparwdzanie czy admin
  866. function isAdmin(nick)
  867. for key, val in pairs(admins) do
  868. if val == nick then
  869. return true
  870. end
  871. end
  872. return false
  873. end
  874.  
  875. ---- sprawdzanie komend
  876. function cmd(com, args, nick)
  877. if commands[args[1]] then
  878. if not commands[com].arg2 then
  879. commands[com].arg2 = commands[com].arg
  880. end
  881. if commands[com].on == 1 and (((#args - 1) >= commands[com].arg and (#args - 1) <= commands[com].arg2) or commands[com].arg == -1) then
  882. if commands[com].admin == 1 then
  883. for key,val in pairs(admins) do
  884. if val == nick then
  885. commands[com].func(nick, args)
  886. return true
  887. end
  888. end
  889. return false
  890. elseif commands[com].admin == 2 then
  891. for key,val in pairs(superAdmin) do
  892. if val == nick then
  893. commands[com].func(nick, args)
  894. return true
  895. end
  896. end
  897. return false
  898. end
  899. commands[com].func(nick, args)
  900. return true
  901. end
  902. end
  903. return false
  904. end
  905.  
  906. ---- BBcode
  907. function bbcode(text)
  908. text = string.gsub(text, "%[(.?)b%]", "<%1b>")
  909. text = string.gsub(text, "%[(.?)i%]", "<%1i>")
  910. text = string.gsub(text, "%[(.?)u%]", "<%1u>")
  911. text = string.gsub(text, "%[/color%]", "</font>")
  912. text = string.gsub(text, '%[color=#?(......)%]', '<font color="#%1">')
  913. return text
  914. end
  915.  
  916. ---- wyswietlanie komunikatów
  917. function message(nick, msg, color)
  918. local nick2 = nick
  919. if nick == 'all' then
  920. nick2 = nil
  921. end
  922. if color == 'red' then
  923. cr = '#CB546B'
  924. elseif color == 'green' then
  925. cr = '#2ECF73'
  926. elseif color == 'blue' then
  927. cr = '#2F7FCC'
  928. end
  929. ui.addTextArea(2, '<font color="'..cr..'">'..msg..'</font>', nick2, 10, 30, 300, 18, nil, nil,0.9)
  930. timer[nick] = {}
  931. timer[nick].tim = 4
  932. timer[nick].make = function() ui.removeTextArea(2, nick2) end
  933. end
  934.  
  935. ---- terazniejszy czas
  936. function time()
  937. local utc = 2
  938. local h = math.floor(os.time()/1000%86400/60/60) + utc
  939. local m = math.floor(os.time()/1000%86400/60%60)
  940. local s = math.floor(os.time()/1000%86400%60%60)
  941.  
  942. if h >= 24 then h = h -24 end
  943. if h < 10 then h = '0'..h end
  944. if m < 10 then m = '0'..m end
  945. if s < 10 then s = '0'..s end
  946. return h..':'..m..':'..s
  947. end
  948.  
  949. ---- licz spacje
  950. function countSpace(nr, text, d, o)
  951. local xx = nr - string.len(text)
  952. if d ~= nil then
  953. xx = xx/d
  954. end
  955. if o ~= nil then
  956. xx = xx - string.len(o)
  957. end
  958. local space = ' '
  959. for i=2,xx,1 do
  960. space = space..' '
  961. end
  962. return space
  963. end
  964.  
  965. ---- show Help
  966. function showHelp(nick, kx, ky)
  967. local space = countSpace(48, ' ['..lg.refresh..']['..lg.close..']')
  968. local text = '<font face="Courier"><font color="#5DB9D8"><a href="event:move 1">=</a>'..space..'<a href="event:refresh 1">['..lg.refresh..']</a><a href="event:close">['..lg.close..']</a></font></font>\n'..lg.help
  969. if kx == nil and ky == nil then
  970. kx, ky = 200, 40
  971. end
  972. if module.on == 1 then
  973. local h = ''
  974. if modules[module.play].help then
  975. h = modules[module.play].help
  976. end
  977. text = text..'___________________________________________________\n\n<font size="12px"><b>'..lg.minigame..'</b></font> '..modules[module.play].name..'\n\n'..h
  978. end
  979. ui.addTextArea(8, text, nick, kx, ky, 400, 300, nil, nil,0.6)
  980.  
  981.  
  982. end
  983.  
  984. ---- Pokaz kolejke map
  985. function showQueue(nick, kx, ky)
  986. if kx == nil and ky == nil then
  987. kx, ky = 250, 40
  988. end
  989. if settings.queue.on == 0 then
  990. kolejka = '<font color="#EB1D51">'..lg.disabled..'</font>'
  991. else
  992. kolejka = '<VP>'..lg.enabled
  993. end
  994. local space = countSpace(38, ' ['..lg.refresh..']['..lg.close..']')
  995. local napis = '<font face="Courier"><font color="#ED67EA"><a href="event:move 1">=</a>'..space..'<a href="event:refresh 1">['..lg.refresh..']</a><a href="event:close">['..lg.close..']</a></font>\n'
  996. napis = napis..'<p align="center"><font size="20px" color="#ffffff">'..lg.maps_queue..'</font></p>'..lg.queuing..' '..kolejka..'\n<n>'..lg.played..' <j>'..mapNumber..'<n> '..lg.maps2..'\n'
  997. local x = 1
  998. for key,val in pairs(maps) do
  999. if key > mapNumber then
  1000. local space = countSpace(37,x..'. '..maps[key].name..' - '..maps[key].nick..'['..lg.delete..']')
  1001. napis = napis..'<n>'..x..'. <vp>'..maps[key].name..'<n> - <t>'..maps[key].nick..space..'<a href="event:delmap '..key..'"><font color="#CB546B">['..lg.delete..']</font></a>\n'
  1002. x = x+1
  1003. end
  1004. end
  1005. ui.addTextArea(1, napis, nick, kx, ky, 300, 300, nil, nil,0.6)
  1006. end
  1007.  
  1008. ---- pokaz opcje
  1009. function options(nick, kx, ky)
  1010. if kx == nil and ky == nil then
  1011. kx, ky = 10, 40
  1012. end
  1013. local adm = ' '
  1014. local add = ' '
  1015. for key,val in pairs(admins) do
  1016. adm = adm..'<font color="#BABD2F">'..val..'</font>, '
  1017. add = add..val..', '
  1018. end
  1019. local space = countSpace(96 , ' ['..lg.refresh..']['..lg.close..']')
  1020. local space2 = countSpace(95 , lg.admins..':'..add..' - '..lg.enabled..' - '..lg.disabled)
  1021. local text = [[<font face="Courier"><a href="event:move 6">=</a>]]..space..[[<a href="event:refresh3">[]]..lg.refresh..[[]</a><a href="event:close">[]]..lg.close..[[]</a></font>
  1022. <p align="center"><font size="19px">]]..lg.settings..[[</font></p>]]..[[
  1023.  
  1024. <font face="Courier">]]..lg.admins..[[:]]..adm..space2..[[<font color="#40B033">¦ - ]]..lg.enabled..[[</font> <font color="#E33D3D">¦ - ]]..lg.disabled..[[</font></font>
  1025. ]]
  1026. local color
  1027. x = 1
  1028. for key,val in spairs(settings) do
  1029. local onOff
  1030. if val.on == 1 then
  1031. color = '#40B033'
  1032. onOff = '[<a href="event:set off '..key..'"><font color="#E33D3D">'..lg.enable..'</font></a>]'
  1033. else
  1034. color = '#E33D3D'
  1035. onOff = '[<a href="event:set on '..key..'"><font color="#40B033">'..lg.disable..'</font></a>]'
  1036. end
  1037. if not isAdmin(nick) then onOff = ''end
  1038. local line = onOff..' <font color="'..color..'">'..key..'</font> - '..val.des..'\n'
  1039.  
  1040. text = text..line
  1041.  
  1042. x = x+1
  1043. end
  1044. text = text..'\n<font color="#ED67EA"><a href="event:stat_reset">['..lg.reset_settings..']</a></font>'
  1045. ui.addTextArea(6, text, nick, kx, ky, 780, 335, 0x424C6B, nil,0.7)
  1046. end
  1047.  
  1048. ---- pokaz liste komend
  1049. function showCmd(nick, kx, ky)
  1050. if kx == nil and ky == nil then
  1051. kx, ky = 10, 40
  1052. end
  1053. local adm = ' '
  1054. local add = ' '
  1055. for key,val in pairs(admins) do
  1056. adm = adm..'<font color="#BABD2F">'..val..'</font>, '
  1057. add = add..val..', '
  1058. end
  1059.  
  1060. local space = countSpace(96 , ' ['..lg.refresh..']['..lg.close..']')
  1061. local space2 = countSpace(96 , lg.admins..': '..add..' - '..lg.enabled..' - '..lg.disabled..' * - '..lg.for_admins)
  1062. local text = [[<font face="Courier"><a href="event:move 3">=</a>]]..space..[[<a href="event:refresh3"><font color="">[]]..lg.refresh..[[]</font></a><a href="event:close"><font color="">[]]..lg.close..[[]</font></a>
  1063. <p align="center"><font size="19px">]]..lg.commands..[[</font></p>]]..lg.admins..[[:]]..adm..space2..[[<font color="#40B033">¦ - ]]..lg.enabled..[[</font> <font color="#E33D3D">¦ - ]]..lg.disabled..[[</font> <font color="#B32EAA">* - ]]..lg.for_admins..[[</font></font>]]
  1064. local text1 = '<font face="Courier">'
  1065. local text2 = '<font face="Courier">'
  1066. local color
  1067. x = 1
  1068. for key,val in spairs(commands) do
  1069. local arg = ''
  1070. local arg2 = ''
  1071. local star = ' '
  1072. for i=1, val.arg, 1 do
  1073. arg = arg..'&lt;arg'..i..'> '
  1074. end
  1075. if val.arg2 ~= nil then
  1076. for i=1, val.arg2 - val.arg, 1 do
  1077. arg2 = arg2..'[arg'..i..'] '
  1078. end end
  1079. if val.admin == 1 then
  1080. star = '<font color="#B32EAA">*</font>'
  1081. end
  1082. if val.on == 1 then
  1083. color = '#40B033'
  1084. else
  1085. color = '#E33D3D'
  1086. end
  1087. local line = star..'<font color="'..color..'">!'..key..' '..arg..arg2..'- '..val.des..'</font>\n'
  1088. if string.len('!'..key..arg..arg2..' - '..val.des) > 47 then
  1089. x = x+1
  1090. end
  1091. if x>22 then
  1092. text2 = text2..line
  1093. else
  1094. text1 = text1..line
  1095. end
  1096. x = x+1
  1097. end
  1098. text1 = text1..'</font>'
  1099. text2 = text2..'</font>'
  1100.  
  1101. ui.addTextArea(3, text, nick, kx, ky, 780, 335, 0x424C6B, nil,0.9)
  1102. ui.addTextArea(4, text1, nick, kx, ky+45, 385, 305, 0x000000, nil,0.6)
  1103. ui.addTextArea(5, text2, nick, kx+395, ky+45, 385, 305, 0x000000, nil,0.6)
  1104. end
  1105.  
  1106. -- pokaz minigry
  1107. function showModules(nick, kx, ky)
  1108. if kx == nil and ky == nil then
  1109. kx, ky = 200, 40
  1110. end
  1111. local space = countSpace(49 , ' ['..lg.close..']')
  1112. local text = [[<font face="Courier"><a href="event:move 7">=</a>]]..space..[[<a href="event:close">[]]..lg.close..[[]</a></font>
  1113. <font size="19px"><p align="center">]]..lg.minigames..[[</p></font>
  1114. <font color="#BABD2F">]]..lg.module_stop..[[</font>
  1115.  
  1116.  
  1117. ]]
  1118. local color
  1119. x = 1
  1120. for key,val in spairs(modules) do
  1121. local author = ''
  1122. if modules[key].author then
  1123. author = ' by '..modules[key].author
  1124. end
  1125. text = text..'<font color="#40B033"><a href="event:module '..key..'">!module '..key..'</a></font> - '..modules[key].name..author..'\n'
  1126. end
  1127. ui.addTextArea(7, text, nick, kx, ky, 400, 335, 0x424C6B, nil, 0.7)
  1128. end
  1129.  
  1130. --
  1131. function modulePlay(nick, name)
  1132. if commands.module.admin > 0 then
  1133. if not isAdmin(nick) then
  1134. return
  1135. end
  1136. end
  1137. module.on = 1
  1138. module.play = name
  1139. message('all', lg.minigame..': '..modules[name].name, 'blue')
  1140. if modules[name].func then
  1141. modules[name]:func(args)
  1142. end
  1143.  
  1144. end
  1145.  
  1146. -------- EVENTS --------
  1147. -- nowy gracz
  1148. function eventNewPlayer(nick)
  1149. if module.on == 1 then
  1150. -- modules on
  1151. if modules[module.play].eventNewPlayer then
  1152. modules[module.play]:eventNewPlayer(nick)
  1153. end
  1154. else
  1155. -- modules off
  1156.  
  1157. end
  1158. -- rest
  1159. ui.addTextArea(0, ' ', nick, 10, 30, 1, 1, 0x56F73D, 0x56F73D, 0.5)
  1160. system.bindMouse(nick,true)
  1161. for key,val in pairs({27, 72, 73, 77, 79}) do
  1162. tfm.exec.bindKeyboard(nick,val,true,true)
  1163. end
  1164. for key,val in pairs({72, 73, 77}) do
  1165. tfm.exec.bindKeyboard(nick,val,false,true)
  1166. end
  1167.  
  1168. end
  1169.  
  1170.  
  1171.  
  1172. -- eventPlayerDied
  1173. function eventPlayerDied(nick)
  1174. if module.on == 1 then
  1175. -- modules on
  1176. if modules[module.play].eventPlayerDied then
  1177. modules[module.play]:eventPlayerDied(nick)
  1178. end
  1179. else
  1180. -- modules off
  1181.  
  1182. end
  1183. if settings.autorespawn.on == 1 or house ~= nil then
  1184. tfm.exec.respawnPlayer(nick)
  1185. end
  1186. end
  1187.  
  1188. -- eventPlayerWon(String playerName)
  1189. function eventPlayerWon(nick)
  1190. if module.on == 1 then
  1191. -- modules on
  1192. if modules[module.play].eventPlayerWon then
  1193. modules[module.play]:eventPlayerWon(nick)
  1194. end
  1195. else
  1196. -- modules off
  1197.  
  1198. end
  1199. if house ~= nil then
  1200. tfm.exec.respawnPlayer(nick)
  1201. end
  1202. end
  1203.  
  1204. ---- petla
  1205. function eventLoop(t1, t2)
  1206. if module.on == 1 then
  1207. -- modules on
  1208. if modules[module.play].eventLoop then
  1209. modules[module.play]:eventLoop(t1, t2)
  1210. end
  1211. else
  1212. -- modules off
  1213.  
  1214. end
  1215. if wait ~= 0 then
  1216. wait = wait -1
  1217. end
  1218. -- queue on, nowa mapa
  1219. if settings.queue.on == 1 and #maps > mapNumber and t2 < t1 and wait == 0 then
  1220. mapNumber = mapNumber +1
  1221. if not tfm.exec.newGame(maps[mapNumber].code) then
  1222. wait = 6
  1223. end
  1224. -- wszyscy martwi
  1225. elseif settings.queue.on == 1 and wait == 0 then
  1226. local dead = 1
  1227. for key,val in pairs(tfm.get.room.playerList) do
  1228. if not tfm.get.room.playerList[key].isDead then
  1229. dead = 0
  1230. break
  1231. end
  1232. end
  1233. if dead == 1 then
  1234. if #maps > mapNumber then
  1235. mapNumber = mapNumber +1
  1236. if not tfm.exec.newGame(maps[mapNumber].code) then
  1237. wait = 6
  1238. end
  1239. else
  1240. tfm.exec.newGame(0)
  1241. end
  1242. end
  1243. end
  1244. -- komunikaty
  1245. for key,val in pairs(timer) do
  1246. if timer[key].tim == 0 then
  1247. timer[key].make()
  1248. else
  1249. timer[key].tim = timer[key].tim - 1
  1250. end
  1251. end
  1252. -- auto teleportacja
  1253. for key,val in pairs(playerPosition) do
  1254. local x = playerPosition[key].x
  1255. local y = playerPosition[key].y
  1256. tfm.exec.movePlayer(key, x, y, 0, -1,-1)
  1257. end
  1258. -- piesek
  1259. for key,val in pairs(pet) do
  1260. local x = tfm.get.room.playerList[val].x
  1261. local y = tfm.get.room.playerList[val].y
  1262. tfm.exec.movePlayer(key, x, y, 0, -1,-1)
  1263. end
  1264. end
  1265.  
  1266. -- klawiatura
  1267. function eventKeyboard(nick ,key ,down ,x ,y)
  1268. if module.on == 1 then
  1269. -- modules on
  1270. if modules[module.play].eventKeyboard then
  1271. modules[module.play]:eventKeyboard(nick ,key ,down ,x ,y)
  1272. end
  1273. else
  1274. -- modules off
  1275.  
  1276. end
  1277. -- esc
  1278. if key == 27 then
  1279. for i=1, 10, 1 do
  1280. ui.removeTextArea(i, nick)
  1281. end
  1282. -- m - modules
  1283. elseif key == 77 then
  1284. if down then
  1285. showModules(nick)
  1286. else
  1287. ui.removeTextArea(7, nick)
  1288. end
  1289. -- o - opcje
  1290. elseif key == 79 then
  1291. options(nick)
  1292. -- h - help
  1293. elseif key == 72 then
  1294. if down then
  1295. showHelp(nick)
  1296. else
  1297. ui.removeTextArea(8, nick)
  1298. end
  1299. elseif key == 73 then
  1300. if down then
  1301. showCmd(nick)
  1302. else
  1303. ui.removeTextArea(3, nick)
  1304. ui.removeTextArea(4, nick)
  1305. ui.removeTextArea(5, nick)
  1306. end
  1307. end
  1308. end
  1309.  
  1310. ---- klikniecie
  1311. function eventMouse(nick, x, y)
  1312. if module.on == 1 then
  1313. -- modules on
  1314. if modules[module.play].eventMouse then
  1315. modules[module.play]:eventMouse(nick, x, y)
  1316. end
  1317. else
  1318. -- modules off
  1319.  
  1320. end
  1321. -- przenoszenie menu
  1322. if move[nick] ~= nil then
  1323. if move[nick] == 6 then
  1324. options(nick, x-8, y-8)
  1325. elseif move[nick] == 1 then
  1326. showQueue(nick, x-8, y-8)
  1327. elseif move[nick] == 3 then
  1328. showCmd(nick, x-8, y-8)
  1329. elseif move[nick] == 8 then
  1330. showHelp(nick, x-8, y-8)
  1331. elseif move[nick] == 7 then
  1332. showModules(nick, x-8, y-8)
  1333. end
  1334. move[nick] = nil
  1335. else
  1336. -- tp
  1337. for key,val in pairs(tp) do
  1338. if key == nick then
  1339. tpp[key] = nil
  1340. playerPosition[key] = nil
  1341. tfm.exec.movePlayer(val, x, y, 0, -1,-1)
  1342. break
  1343. end
  1344. end
  1345. -- tpp
  1346. for key,val in pairs(tpp) do
  1347. if key == nick then
  1348. playerPosition[val] = {}
  1349. playerPosition[val].x = x
  1350. playerPosition[val].y = y
  1351. break
  1352. end
  1353. end
  1354. end
  1355. end
  1356. function name(i, nick)
  1357. if #args < (i+1) then
  1358. return nick
  1359. else
  1360. return args[i+1]
  1361. end
  1362. end
  1363. ---- !komendy
  1364. function eventChatCommand(nick, msg)
  1365. if module.on == 1 then
  1366. -- modules on
  1367. if modules[module.play].eventChatCommand then
  1368. modules[module.play]:eventChatCommand(nick, msg)
  1369. end
  1370. else
  1371. -- modules off
  1372.  
  1373. end
  1374. -- log
  1375. Log = '['..time()..'] '..nick..' - !'..msg..'\n'..Log
  1376. -- dzielenie argumentów
  1377. local args={}
  1378. for arg in msg:gmatch("[^%s]+") do
  1379. table.insert(args,arg)
  1380. end
  1381. rest = msg:match("%s(.*)") or ""
  1382. -- wylaczenie dostepu dla tych z banem
  1383. for key,val in pairs(ban) do
  1384. for k,v in pairs(superAdmin) do
  1385. if key == nick and val == true and nick ~= v then
  1386. message(nick, lg.banned, 'red')
  1387. return false
  1388. end
  1389. end
  1390. end
  1391. function name(i)
  1392. if #args < (i+1) then
  1393. return nick
  1394. else
  1395. return args[i+1]
  1396. end
  1397. end
  1398. -------------
  1399. cmd(args[1], args, nick)
  1400.  
  1401. end
  1402.  
  1403. ---- odwolania z <a>
  1404. function eventTextAreaCallback(id, nick, callback)
  1405. if module.on == 1 then
  1406. -- modules on
  1407. if modules[module.play].eventTextAreaCallback then
  1408. modules[module.play]:eventTextAreaCallback(id, nick, callback)
  1409. end
  1410. else
  1411. -- modules off
  1412.  
  1413. end
  1414. local args={}
  1415. for arg in callback:gmatch("[^%s]+") do
  1416. table.insert(args,arg)
  1417. end
  1418. -- zamykanie
  1419. if callback == 'close' then
  1420. if id == 3 then
  1421. ui.removeTextArea(3, nick)
  1422. ui.removeTextArea(4, nick)
  1423. ui.removeTextArea(5, nick)
  1424. else
  1425. ui.removeTextArea(id, nick)
  1426. end
  1427. -- odswiezanie
  1428. elseif args[1] == 'refresh' then
  1429. if id == 1 then
  1430. showQueue(nick)
  1431. elseif id == 6 then
  1432. options(nick)
  1433. end
  1434. -- ustawienia
  1435. elseif args[1] == 'set' then
  1436. if args[2] == 'on' then
  1437. settings[args[3]].on = 1
  1438. settings[args[3]].fOn()
  1439. else
  1440. settings[args[3]].on = 0
  1441. settings[args[3]].fOff()
  1442. end
  1443. options(nick)
  1444. -- przenoszenie textarea
  1445. elseif args[1] == 'move' then
  1446. move[nick] = id
  1447. -- resetowanie ustawien
  1448. elseif args[1] == 'stat_reset' then
  1449. for key,val in pairs(settings) do
  1450. settings[key].on = settings[key].def
  1451. end
  1452. options(nick)
  1453. -- !maps usuwanie
  1454. elseif args[1] == 'delmap' then
  1455. if isAdmin(nick) then
  1456. table.remove(maps, args[2])
  1457. showQueue(nick)
  1458. end
  1459. -- moduly
  1460. elseif args[1] == 'module' then
  1461. modulePlay(nick, args[2])
  1462. end
  1463. end
  1464.  
  1465. function eventEmotePlayed(nick, emoteId)
  1466. if module.on == 1 then
  1467. -- modules on
  1468. if modules[module.play].eventEmotePlayed then
  1469. modules[module.play]:eventEmotePlayed(nick, emoteId)
  1470. end
  1471. else
  1472. -- modules off
  1473.  
  1474. end
  1475. end
  1476.  
  1477. function eventPlayerGetCheese(nick)
  1478. if module.on == 1 then
  1479. -- modules on
  1480. if modules[module.play].eventPlayerGetCheese then
  1481. modules[module.play]:eventPlayerGetCheese(nick)
  1482. end
  1483. else
  1484. -- modules off
  1485.  
  1486. end
  1487. end
  1488.  
  1489. function eventPlayerLeft(nick)
  1490. if module.on == 1 then
  1491. -- modules on
  1492. if modules[module.play].eventPlayerLeft then
  1493. modules[module.play]:eventPlayerLeft(nick)
  1494. end
  1495. else
  1496. -- modules off
  1497.  
  1498. end
  1499. end
  1500.  
  1501. function eventPlayerVampire(nick)
  1502. if module.on == 1 then
  1503. -- modules on
  1504. if modules[module.play].eventPlayerVampire then
  1505. modules[module.play]:eventPlayerVampire(nick)
  1506. end
  1507. else
  1508. -- modules off
  1509.  
  1510. end
  1511. end
  1512.  
  1513. function eventPlayerWon(nick)
  1514. if module.on == 1 then
  1515. -- modules on
  1516. if modules[module.play].eventPlayerWon then
  1517. modules[module.play]:eventPlayerWon(nick)
  1518. end
  1519. else
  1520. -- modules off
  1521.  
  1522. end
  1523. end
  1524.  
  1525. function eventPlayerRespawn(nick)
  1526. if module.on == 1 then
  1527. -- modules on
  1528. if modules[module.play].eventPlayerRespawn then
  1529. modules[module.play]:eventPlayerRespawn(nick)
  1530. end
  1531. else
  1532. -- modules off
  1533.  
  1534. end
  1535. end
  1536.  
  1537. function eventPopupAnswer(id, nick, answer)
  1538. if module.on == 1 then
  1539. -- modules on
  1540. if modules[module.play].eventPopupAnswer then
  1541. modules[module.play]:eventPopupAnswer(id, nick, answer)
  1542. end
  1543. else
  1544. -- modules off
  1545.  
  1546. end
  1547. end
  1548.  
  1549. function eventSummoningStart(nick, objectType, x, y, angle)
  1550. if module.on == 1 then
  1551. -- modules on
  1552. if modules[module.play].eventSummoningStart then
  1553. modules[module.play]:eventSummoningStart(nick, objectType, x, y, angle)
  1554. end
  1555. else
  1556. -- modules off
  1557.  
  1558. end
  1559. end
  1560.  
  1561. function eventSummoningCancel(nick)
  1562. if module.on == 1 then
  1563. -- modules on
  1564. if modules[module.play].eventSummoningCancel then
  1565. modules[module.play]:eventSummoningCancel(nick)
  1566. end
  1567. else
  1568. -- modules off
  1569.  
  1570. end
  1571. end
  1572.  
  1573. function eventSummoningEnd(nick, objectType, x, y, angle, xSpeed, ySpeed, objectType, other)
  1574. if module.on == 1 then
  1575. -- modules on
  1576. if modules[module.play].eventSummoningEnd then
  1577. modules[module.play]:eventSummoningEnd(nick, objectType, x, y, angle, xSpeed, ySpeed, objectType, other)
  1578. end
  1579. else
  1580. -- modules off
  1581.  
  1582. end
  1583. end
  1584.  
  1585. function eventNewGame()
  1586. if module.on == 1 then
  1587. -- modules on
  1588. if modules[module.play].eventNewGame then
  1589. modules[module.play]:eventNewGame()
  1590. end
  1591. else
  1592. -- modules off
  1593.  
  1594. end
  1595. end
  1596.  
  1597. -- wylaczenie widzialnosci komend
  1598. for k,v in pairs(commands) do
  1599. system.disableChatCommandDisplay(k, true)
  1600. end
  1601.  
  1602. -- wymuszenie nowego gracza
  1603. for playername,player in pairs(tfm.get.room.playerList) do
  1604. eventNewPlayer(playername)
  1605. end
  1606.  
  1607. print 'Ultimate Tribe House Script loaded'
  1608.  
  1609. ---- koniec skryptu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement