Advertisement
Guest User

chlasc

a guest
Apr 19th, 2014
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 62.58 KB | None | 0 0
  1. superAdmin = {'Erikq'}
  2. admins = {'Iulianbuhai', 'Pufulinaa', 'Inffernape', 'Cristianorod', 'Erikq'}
  3. language = 'ro' -- 'en' or 'ro'
  4.  
  5. version = '1.6'
  6. lang = {}
  7. lang.ro = {
  8.     help = [[<p align="center"><font size="19px">Ultimate Tribe House Script</font> v. ]]..version..[[</p><p align="right"><font size="10px" color="#ffffff">Creat de Erikq</font></p>Comenzi:
  9.     !cmd - se activeaza comanda
  10.     !set - setari
  11.     !help - ajutor
  12. comenzi pe tastatura:
  13.     h - ajutor
  14.     Esc - iesi din tabel
  15.     i - comenzi
  16.     o - setari
  17.     m - minijocuri
  18. ]],
  19.     disabled = 'Off',
  20.     enabled = 'On',
  21.     disable = 'dezactivat',
  22.     enable = 'activat',
  23.     refresh = 'reimprospatare',
  24.     close = 'inchide',
  25.     minigame = 'Minijoc',
  26.     minigames = 'Minijocuri',
  27.     module_stop = '!module stop - dezactivezi minijocul',
  28.  
  29.     maps_queue = 'Harti in asteptare',
  30.     queuing = 'Asteptare',
  31.     played = 'a jucat',
  32.     maps2 = 'map',
  33.     delete = 'sterge',
  34.     admins = 'Admins',
  35.     reset_settings = 'resetare setari',
  36.     settings = 'Setarile',
  37.     commands = 'Comenzi',
  38.     for_admins = 'Admin',
  39.     banned = 'Interzis',
  40.     a = '',
  41.     a = '',
  42.    
  43.     module_des = ':Lista cu minijocuri',
  44.     made_des = 'nou (se lucreaza..)',
  45.     kill_des = 'Mori',
  46.     ice_des = 'cheata',
  47.     sham_des = 'shaman',
  48.     ch_des = 'branza',
  49.     tp_des = 'teleportare',
  50.     utp_des = 'teleportare cu lipici dezactivat [unglue player]',
  51.     tpp_des = 'teleportare cu lipici',
  52.     re_des = 'sterge toate obiectele [Shaman]',
  53.     meep_des = 'activeaza meep',
  54.     ban_des = 'Dezactiveaza comanda <nick>',
  55.     unban_des = 'Activeaza inapoi comanda <nick>',
  56.     admin_des = 'Add admins',
  57.     unadmin_des = 'sterge adminu <nick>',
  58.     score_des = 'scor Ex: !score nume cifra',
  59.     mapname_des = 'Modifica numele de la mapa',
  60.     shamname_des = 'Modifica numele de la shaman',
  61.     respawn_des = 'respawn',
  62.     autorespawn_des = 'On/Off respawn',
  63.     datl_des = 'On/Off time',
  64.     color_des = 'culoare nume : Ex:!color Nume ffffff',
  65.     queue_des = 'on/off maps queuing',
  66.     maps_des = 'arata hartile in coada',
  67.     np_des = 'adaugi o harta',
  68.     npp_des = 'adauga o harta in coada',
  69.     mort_des = 'omoaral pe cineva',
  70.     off_des = 'inchide comenzile',
  71.     on_des = 'porneste comenzile',
  72.     cmd_des = 'lista cu comenzi',
  73.     pet_des = 'se transforma in animal de companie <arg1>',
  74.     unpet = 'dezactiveaza !pet',
  75.     set_des = 'Arata setarile',
  76.     xml_des = 'Incarca o harta in XML',
  77.     house_des = 'Stabileste coliba tribal',
  78.     help_des = 'ajutor',
  79.     vampire_des = 'Te transformi intr-un vampir',
  80.     log_des = 'istoric actiuni',
  81.     queue_set = 'mapa in asteptare',
  82.     autorespawn_set = 'respawn automat',
  83.     autoTimeLeft_set = 'autoTimeLeft',
  84.     afk_set = 'dezactiveaza AFK',
  85.     autoNewGame_set = 'auto map change',
  86.     autoScore_set = 'auto score',
  87.     autoShaman_set = 'automat shaman',
  88.     shamanSkills_set = 'activeaza noile puteri',
  89.     settime_des = 'timpul',
  90.     snow_des = 'ninge!!',
  91.     _des = '',
  92.     _des = '',
  93.     _des = '',
  94.  
  95. }
  96. lang.en = {
  97.     help = [[<p align="center"><font size="19px">Tribe House Script</font> v. ]]..version..[[</p><p align="right"><font size="10px" color="#ffffff">Created by Erikq</font></p>Commands:
  98.     !cmd - shows commands
  99.     !set - shows settings
  100.     !help - shows help
  101. Hotkeys:
  102.     h - shows help
  103.     Esc - closes window
  104.     i - shows commands
  105.     o - shows settings
  106.     m - shows minigames
  107. ]],
  108.     disabled = 'Off',
  109.     enabled = 'On',
  110.     disable = 'disable',
  111.     enable = 'enable',
  112.     refresh = 'refresh',
  113.     close = 'close',
  114.     minigames = 'Minigames',
  115.     minigame = 'Minigame',
  116.     module_stop = '!module stop - to turn off minigame',
  117.  
  118.     maps_queue = 'Maps queue',
  119.     queuing = 'Queuing',
  120.     played = 'played',
  121.     maps2 = 'maps',
  122.     delete = 'delete',
  123.     admins = 'Admins',
  124.     reset_settings = 'reset settings',
  125.     settings = 'Settings',
  126.     commands = 'Commands',
  127.     for_admins = 'Admins',
  128.     banned = 'You are banned',
  129.    
  130.     module_des = 'shows list of minigames',
  131.     made_des = 'new commend',
  132.     kill_des = 'kills',
  133.     ice_des = 'freezes',
  134.     sham_des = 'gives shaman',
  135.     ch_des = 'gives cheese',
  136.     tp_des = 'teleport',
  137.     utp_des = 'diesables teleport, [unglue player]',
  138.     tpp_des = 'teleport with glue',
  139.     re_des = 'removes all objects',
  140.     meep_des = 'gives meep',
  141.     ban_des = 'disables commands for <name>',
  142.     unban_des = 'enables commands for <name>',
  143.     admin_des = 'gives admin rank',
  144.     unadmin_des = 'withdraws admin rank',
  145.     score_des = 'sets <player> score',
  146.     mapname_des = 'changes map name',
  147.     shamname_des = 'changes shaman name',
  148.     respawn_des = 'respawns',
  149.     autorespawn_des = 'on/off autorespawn',
  150.     color_des = 'sets nickname color',
  151.     queue_des = 'on/off maps queuing',
  152.     maps_des = 'queuing',
  153.     np_des = 'plays map',
  154.     npp_des = 'adds map to queue',
  155.     mort_des = 'kill yourself',
  156.     off_des = 'disables command',
  157.     on_des = 'enables command',
  158.     cmd_des = 'shows commands list',
  159.     pet_des = 'converts <name> into pet',
  160.     unpet = 'withdraws !pet',
  161.     set_des = 'shows settings lists',
  162.     xml_des = 'plays map from xml code',
  163.     house_des = 'sets tribe house',
  164.     help_des = 'shows help',
  165.     vampire_des = 'turns into vampire',
  166.     log_des = 'shows !commands log',
  167.     queue_set = 'maps queuing',
  168.     autorespawn_set = 'auto respwan',
  169.     autoTimeLeft_set = 'automatic time change',
  170.     afk_set = 'AFK death',
  171.     autoNewGame_set = 'auto map change',
  172.     autoScore_set = 'auto score',
  173.     autoShaman_set = 'automatic selection of Shaman',
  174.     shamanSkills_set = 'shaman skills',
  175.     settime_des = 'sets game time',
  176.     snow_des = 'toggles snow',
  177.     _des = '',
  178.     _des = '',
  179.     _des = '',
  180.  
  181. }
  182. lg = lang[language]
  183. mapNumber = 0
  184. wait = 0
  185. Log = '\n'
  186. tp = {}
  187. tpp = {}          
  188. playerPosition = {}
  189. ban = {}
  190. maps = {}
  191. ob = {}
  192. timer = {}
  193. pet = {}
  194. move = {}
  195. xml = {}
  196. vote = {}
  197. fly = false
  198.  
  199. commands = {
  200.     kill = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.kill_des, func = function(nick, args)
  201.         tfm.exec.killPlayer(name(1))
  202.     end},
  203.     ice = {on = 1, admin = 1, arg = 1, des = lg.ice_des, func = function(nick, args)
  204.         if tfm.get.room.playerList[args[2]] then
  205.             local y = tfm.get.room.playerList[args[2]].y
  206.             local x = tfm.get.room.playerList[args[2]].x
  207.             tfm.exec.addShamanObject(54, x, y, 0, 0, 0, false)
  208.             tfm.exec.killPlayer(args[2])
  209.         end
  210.     end},
  211.     sham = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.sham_des, func = function(nick, args)
  212.         tfm.exec.setShaman(name(1))
  213.         print("<b><R>[SYSTEM]</R></b><BV>Sa transformat un shaman[!log]</BV>")
  214.     end},
  215.     ch = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.ch_des, func = function(nick, args)
  216.         tfm.exec.giveCheese(name(1))
  217.         print("<b><R>[SYSTEM]</R></b><BV>Branza[!log]</BV>")
  218.     end},
  219.     tp = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.tp_des, func = function(nick, args)
  220.         system.bindMouse(nick,true)
  221.         tpp[nick] = nil
  222.         tp[nick] = args[2] 
  223.         print("<b><R>[SYSTEM]</R></b><BV>Sa activat tp [!log]</BV>")
  224.     end},
  225.     tpp = {on = 1, admin = 0, arg = 0, arg = 1, des = lg.tpp_des, func = function(nick, args)
  226.         system.bindMouse(nick,true)
  227.         tp[nick] = nil
  228.         tpp[nick] = args[2]
  229.         print("<b><R>[SYSTEM]</R></b><BV>Sa activat tpp(lipici)[!log]</BV>")
  230.     end},
  231.     utp = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.utp_des, func = function(nick, args)
  232.         playerPosition[name(1)] = nil
  233.         tpp[nick] = nil
  234.         tp[nick] = nil
  235.         playerPosition[nick] = nil
  236.         print("<b><R>[SYSTEM]</R></b><BV>A dezactivat tpp[!log]</BV>")
  237.     end},
  238.     re = {on = 1, admin = 1, arg = 0, des = lg.re_des, func = function(nick, args)
  239.         for key,val in pairs(tfm.get.room.objectList) do
  240.             table.insert(ob, key)
  241.         end
  242.         for key,val in pairs(ob) do
  243.             tfm.exec.removeObject(val)
  244.         end
  245.         ob = {}
  246.         print("<b><R>[SYSTEM]</R></b><BV>A sters obiectele shaman[!log]</BV>")
  247.     end},
  248.     meep = {on = 1, admin = 0, arg = 1, des = lg.meep_des, func = function(nick, args)
  249.         tfm.exec.giveMeep(args[2])
  250.         print("<b><R>[SYSTEM]</R></b><BV>Meep activat de:[!log]</BV>")
  251.     end},
  252.     ban = {on = 1, admin = 1, arg = 1, des = lg.ban_des, func = function(nick, args)
  253.         ban[args[2]] = true
  254.         print("<b><R>[SYSTEM]</R></b><BV>Cineva a fost banat[!log]</BV>")
  255.     end},
  256.     unban = {on = 1, admin = 1, arg = 1, des = lg.unban_des, func = function(nick, args)
  257.         ban[args[2]] = false
  258.         print("<b><R>[SYSTEM]</R></b><BV>Cineva a primit unban[!log]</BV>")
  259.     end},
  260.     admin = {on = 1, admin = 1, arg = 1, des = lg.admin_des, func = function(nick, args)
  261.         table.insert(admins, args[2])
  262.         print("<b><R>[SYSTEM]</R></b><BV>Cineva a pus administrator[!log]</BV>")
  263.     end},
  264.     unadmin = {on = 1, admin = 2, arg = 1, des = lg.unadmin_des, func = function(nick, args)
  265.         for i=1,#admins,1 do
  266.             if admins[i] == args[2] then
  267.                 table.remove(admins, i)
  268.             end
  269.         end
  270.         print("<b><R>[SYSTEM]</R></b><BV>A sters un administrator[!log]</BV>")
  271.     end},
  272.     score = {on = 1, admin = 0, arg = 1, arg2 = 2, des = lg.score_des, func = function(nick, args)
  273.         tfm.exec.setPlayerScore(args[2], args[3], 0)
  274.         print("<b><R>[SYSTEM]</R></b><BV>Scor activat[!log]</BV>")
  275.     end},
  276.     mapname = {on = 1, admin = 0, arg = -1, des = lg.mapname_des, func = function(nick, args)
  277.         tfm.exec.setUIMapName(bbcode(rest))
  278.         print("<b><R>[SYSTEM]</R></b><BV>A schimbat numele de la mapa[!log]</BV>")
  279.     end},
  280.     shamname = {on = 1, admin = 0, arg = -1, des = lg.shamname_des, func = function(nick, args)
  281.         tfm.exec.setUIShamanName(bbcode(rest))
  282.         print("<b><R>[SYSTEM]</R></b><BV>A schimbat numele de la shaman :[!log]</BV>")
  283.     end},
  284.     respawn = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.respawn_des, func = function(nick, args)
  285.         tfm.exec.respawnPlayer(name(1))
  286.         print("<b><R>[SYSTEM]</R></b><BV>Respawn activat[!log]</BV>")
  287.     end},
  288.     autorespawn = {on = 1, admin = 0, arg = 1, des = lg.autorespawn_des, func = function(nick, args)
  289.         if args[2] == 'off' then
  290.             settings.autorespawn.on = 0
  291.         else   
  292.             settings.autorespawn.on = 1
  293.         end
  294.         print("<b><R>[SYSTEM]</R></b><BV>Autorespawn...[!log]</BV>")
  295.     end},
  296.     color = {on = 1, admin = 0, arg = 1, arg = 2, des = lg.color_des, func = function(nick, args)
  297.         tfm.exec.setNameColor(args[2],'0x'..args[3])
  298.         print("<b><R>[SYSTEM]</R></b><BV>color adaugat de :[!log]</BV>")
  299.     end},
  300.     queue = {on = 1, admin = 0, arg = 1, des = lg.queue_des, func = function(nick, args)
  301.         if args[2] == 'off' then
  302.             settings.queue.on = 0
  303.             tfm.exec.disableAutoNewGame(false)
  304.         else
  305.             settings.queue.on = 1
  306.             tfm.exec.disableAutoNewGame(true)
  307.             message('all', 'Wlaczono kolejkowanie', 'green')
  308.         end
  309.         print("<b><R>[SYSTEM]</R></b><BV>Activat[!log]</BV>")
  310.     end},
  311.     maps = {on = 1, admin = 0, arg = 0, des = lg.maps_des, func = function(nick, args)
  312.         showQueue(nick)
  313.         print("<b><R>[SYSTEM]</R></b><BV>Activat[!log]</BV>")
  314.     end},
  315.     np = {on = 1, admin = 0, arg = 1, des = lg.np_des, func = function(nick, args)
  316.         tfm.exec.newGame(args[2])
  317.         print("<b><R>[SYSTEM]</R></b><BV>Activat[!log]</BV>")
  318.     end},
  319.     npp = {on = 1, admin = 0, arg = 1, des = lg.npp_des, func = function(nick, args)
  320.         if #maps - mapNumber == 17 then
  321.             message(nick, 'Nie mozesz dodac wiecej map', 'red')
  322.         else
  323.             local code = args[2]
  324.             if args[2] == 'xml' then
  325.                 if not xml[nick] then
  326.                     return false
  327.                 end
  328.                 code = xml[nick].xml
  329.             end
  330.             local mapNr = #maps+1;
  331.             maps[mapNr] = {}
  332.             maps[mapNr].code = code
  333.             maps[mapNr].name = args[2]
  334.             maps[mapNr].nick = nick
  335.         end
  336.         print("<b><R>[SYSTEM]</R></b><BV>A bagat un cod in asteptare[!log]</BV>")
  337.     end},
  338.     meep = {on = 1, admin = 0, arg = 0, des = lg.meep_des, func = function(nick, args)
  339.         tfm.exec.giveMeep(nick)
  340.         print("<b><R>[SYSTEM]</R></b><BV>Meep activat[!log]</BV>")
  341.     end},
  342.     mort = {on = 1, admin = 0, arg = 0, des = lg.mort_des, func = function(nick, args)
  343.         tfm.exec.killPlayer(nick)
  344.         print("<b><R>[SYSTEM]</R></b><BV>A murit[!log]</BV>")
  345.     end},
  346.     off = {on = 1, admin = 1, arg = 1, des = lg.off_des, func = function(nick, args)
  347.         if args[2] == 'off' or args[2] == 'on' then
  348.        
  349.         elseif not commands[args[2]] then
  350.             message(nick, 'Nie ma takiej komendy', 'red')
  351.         else
  352.             commands[args[2]].on = 0
  353.             message(nick, 'Wylaczono "'..args[2]..'"', 'green')
  354.         end
  355.         print("<b><R>[SYSTEM]</R></b><BV>a oprit comenzile[!log]</BV>")
  356.     end},
  357.     on = {on = 1, admin = 1, arg = 1, des = lg.on_des, func = function(nick, args)
  358.         if not commands[args[2]] then
  359.             message(nick, 'Nie ma takiej komendy', 'red')
  360.         else
  361.             commands[args[2]].on = 1
  362.             message(nick, 'Wlaczono "'..args[2]..'"', 'green')
  363.         end
  364.         print("<b><R>[SYSTEM]</R></b><BV>A pornit comenzile[!log]</BV>")
  365.     end},
  366.     cmd = {on = 1, admin = 0, arg = 0, des = lg.cmd_des, func = function(nick, args)
  367.         showCmd(nick)
  368.         print("<b><R>[SYSTEM]</R></b><BV>Un soarece a pornit comanda[!log]</BV>")
  369.     end},
  370.     pet = {on = 1, admin = 1, arg = 1, des = lg.pet_des, func = function(nick, args)
  371.         pet[args[2]] = nick
  372.         print("<b><R>[SYSTEM]</R></b><BV>A activat ca animal de companie[!log]</BV>")
  373.     end},
  374.     unpet = {on = 1, admin = 1, arg = 1, des = lg.unpet,func = function(nick, args)
  375.         pet[args[2]] = nil
  376.         print("<b><R>[SYSTEM]</R></b><BV>A dezactivat[!log]</BV>")
  377.     end},
  378.     set = {on = 1, admin = 0, arg = 0, des = lg.set_des, func = function(nick, args)
  379.         options(nick)
  380.         print("<b><R>[SYSTEM]</R></b><BV>A activat setarile[!log]</BV>")
  381.     end},
  382.     xml = {on = 1, admin = 0, arg = -1, des = lg.xml_des, func = function(nick, args)
  383.         if args[2] == 'start' then
  384.             xml[nick] = {}
  385.             xml[nick].f = 1
  386.             xml[nick].xml = ' '
  387.         elseif args[2] == 'play' then
  388.             if xml[nick] ~= nil then
  389.                 tfm.exec.newGame(xml[nick].xml)    
  390.             end
  391.         elseif xml[nick] ~= nil then
  392.             if xml[nick].f == 1 then
  393.                 xml[nick].xml = string.gsub(rest, "&lt;", "<")
  394.                 xml[nick].f = 0
  395.             else
  396.                 xml[nick].xml = xml[nick].xml..string.gsub(rest, "&lt;", "<")
  397.             end
  398.         end
  399.     end},
  400.     house = {on = 1, admin = 0, arg = 1, des = lg.house_des, func = function(nick, args)
  401.         if args[2] == 'off' then
  402.             house = nil
  403.             tfm.exec.disableAfkDeath(false)
  404.             tfm.exec.disableAutoShaman(false)
  405.             tfm.exec.disableAutoNewGame(false)
  406.         else
  407.             tfm.exec.disableAfkDeath(true)
  408.             tfm.exec.disableAutoShaman(true)
  409.             tfm.exec.disableAutoNewGame(true)
  410.            
  411.             if args[2] == 'xml' then
  412.                 house = xml[nick]
  413.                 tfm.exec.newGame(xml[nick])
  414.             else
  415.                 house = args[2]
  416.                 tfm.exec.newGame(args[2])
  417.             end
  418.            
  419.         end
  420.         print("<b><R>[SYSTEM]</R></b><BV>None[!log]</BV>")
  421.     end},
  422.     help = {on = 1, admin = 0, arg = 0, des = lg.help_des, func = function(nick, args)
  423.         showHelp(nick)
  424.         print("<b><R>[SYSTEM]</R></b><BV>A pornit comanda !help[!log]</BV>")
  425.     end},
  426.     vampire = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.vampire_des, func = function(nick, args)
  427.         tfm.exec.setVampirePlayer(name(1)) 
  428.         print("<b><R>[SYSTEM]</R></b><BV>Cineva e vampir[!log]</BV>")
  429.     end},
  430.     log = {on = 1, admin = 1, arg = 0, arg2 = 0, des = lg.log_des, func = function(nick, args)
  431.         ui.addTextArea(3,  Log:sub(1, 2000), nick, 250, 40, 300, 335, nil, nil,0.7)
  432.         print("<b><R>[SYSTEM]</R></b><BV>Log pornit sa vad istoric actiuni[!log]</BV>")
  433.     end},
  434.     module = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.module_des, func = function(nick, args)
  435.         if not args[2] then
  436.             showModules(nick)
  437.         elseif module.on == 1 and (args[2] == 'stop' or args[2] == 'off')and isAdmin(nick) then
  438.             if modules[module.play].off then
  439.                 modules[module.play]:off(args)
  440.             end
  441.             module.on = 0
  442.             module.play = ''
  443.         elseif isAdmin(nick) and modules[args[2]] then
  444.             modulePlay(nick, args[2])
  445.         end
  446.         print("<b><R>[SYSTEM]</R></b><BV>Module pornit[!log]</BV>")
  447.     end},
  448.     settime = {on = 1, admin = 1, arg = 1, des = lg.settime_des, func = function(nick, args)
  449.         tfm.exec.setGameTime(args[2])  
  450.         print("<b><R>[SYSTEM]</R></b><BV>Timpul modificat[!log]</BV>")
  451.     end},
  452.     snow = {on = 1, admin = 0, arg = 0, des = lg.snow_des, func = function(nick, args)
  453.         tfm.exec.snow()
  454.         print("<b><R>[SYSTEM]</R></b><BV>Zapada 1.07 min[!log]</BV>")
  455.     end},
  456.  
  457.     -- own commands / wlasne komendy
  458.    
  459.  
  460.    
  461.     -- end of own commands / koniec wlasnych komend
  462. }
  463.  
  464. settings = {
  465.     queue = {on = 0, def = 0,
  466.         des = lg.queue_set,
  467.         fOn = function() end,
  468.         fOff = function() end},
  469.     autorespawn = {on = 0, def = 0,
  470.         des = lg.autorespawn_set,
  471.         fOn = function() end,
  472.         fOff = function() end},
  473.     autoTimeLeft = {on = 0, def = 0,
  474.         des = lg.autoTimeLeft_set,
  475.         fOn = function() tfm.exec.disableAutoTimeLeft(false) end,
  476.         fOff = function() tfm.exec.disableAutoTimeLeft(true) end},
  477.     afk = {on = 1, def = 0,
  478.         des = lg.afk_set,
  479.         fOn = function() tfm.exec.disableAfkDeath(false) end,
  480.         fOff = function() tfm.exec.disableAfkDeath(true) end},
  481.     autoNewGame = {on = 1, def = 1,
  482.         des = lg.autoNewGame_set,
  483.         fOn = function() tfm.exec.disableAutoNewGame(false) end,
  484.         fOff = function() tfm.exec.disableAutoNewGame(true) end},
  485.     autoScore = {on = 1, def = 1,
  486.         des = lg.autoScore_set,
  487.         fOn = function() tfm.exec.disableAutoScore(false) end,
  488.         fOff = function() tfm.exec.disableAutoScore(true) end},
  489.     autoShaman = {on = 1, def = 1,
  490.         des = lg.autoShaman_set,
  491.         fOn = function() tfm.exec.disableAutoShaman(false) end,
  492.         fOff = function() tfm.exec.disableAutoShaman(true) end},
  493.     shamanSkills = {on = 1, def = 1,
  494.         des = lg.shamanSkills_set,
  495.         fOn = function() tfm.exec.disableAllShamanSkills(false) end,
  496.         fOff = function() tfm.exec.disableAllShamanSkills(true) end},
  497.     -- own settings / wlasne ustawienia
  498.    
  499.    
  500.    
  501.     -- end of own settings / koniec wlasnych ustawien          
  502. }
  503.  
  504. -- moduly
  505. module = {on = 0, play = ''}
  506. modules = {
  507.     racing = {name = 'Racing''normal'
  508.             tfm.exec.newGame(self.maps[math.random(#self.maps)])
  509.             tfm.exec.disableAutoNewGame(true)
  510.             tfm.exec.disableAutoShaman(true)
  511.             tfm.exec.disableAutoTimeLeft(true)
  512.         end,
  513.         off = function(self)
  514.             tfm.exec.disableAutoNewGame(false)
  515.             tfm.exec.disableAutoShaman(true)
  516.             tfm.exec.disableAutoTimeLeft(false)
  517.         end,
  518.         eventLoop = function(self, t1, t2)
  519.             if self.mode == 'drunk' then
  520.                 if math.random(5) == 1 then
  521.                     for key,val in pairs(tfm.get.room.playerList) do
  522.                         x = math.random(-50, 50)
  523.                         if x ~= 0 then
  524.                             tfm.exec.movePlayer(key, 0, 0, true, math.random(-50, 50), 0, true)
  525.                         end
  526.                     end
  527.                 end
  528.             end
  529.             if t2<=0 then
  530.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  531.             end
  532.         end,
  533.         eventPlayerWon = function(self, name)
  534.             local i=0
  535.             for k,v in pairs(tfm.get.room.playerList) do
  536.                 if not v.isDead then
  537.                     i=i+1
  538.                 end
  539.             end
  540.             if i==0 then
  541.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  542.             end
  543.         end,
  544.         eventPlayerDied = function(self, name)
  545.             local i=0
  546.             for k,v in pairs(tfm.get.room.playerList) do
  547.                 if not v.isDead then
  548.                     i=i+1
  549.                 end
  550.             end
  551.             if i==0 then
  552.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  553.             end
  554.         end,
  555.         eventChatCommand = function(self, name, msg)
  556.             if msg == 'mode drunk' then
  557.                 self.mode = 'drunk'
  558.             elseif msg == 'mode normal' then
  559.                 self.mode = 'normal'
  560.             end
  561.         end,
  562.         eventNewGame = function(self)
  563.             tfm.exec.setGameTime(63)
  564.         end
  565.     },
  566.     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},
  567.         func = function(self)
  568.             tfm.exec.newGame(self.maps[math.random(#self.maps)])
  569.             tfm.exec.disableAutoNewGame(true)
  570.         end,
  571.         off = function(self)
  572.             tfm.exec.disableAutoNewGame(false)
  573.         end,
  574.         eventLoop = function(self, t1, t2)
  575.             if t2<=0 then
  576.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  577.             end
  578.         end,
  579.         eventPlayerDied = function(self, name)
  580.             local i=0
  581.             for k,v in pairs(tfm.get.room.playerList) do
  582.                 if not v.isDead then
  583.                     i=i+1
  584.                 end
  585.             end
  586.             if i==0 then
  587.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  588.             end
  589.         end,
  590.     },
  591.    
  592.     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},
  593.         func = function(self)
  594.             tfm.exec.newGame(self.maps[math.random(#self.maps)])
  595.             tfm.exec.disableAutoNewGame(true)
  596.         end,
  597.         off = function(self)
  598.             tfm.exec.disableAutoNewGame(false)
  599.         end,
  600.         eventLoop = function(self, t1, t2)
  601.             if t2<=0 then
  602.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  603.             end
  604.             local i=0
  605.             for k,v in pairs(tfm.get.room.playerList) do
  606.                 if not v.isDead then
  607.                     i = i+1
  608.                 end
  609.             end
  610.             local x = 0
  611.             for k,v in pairs(tfm.get.room.playerList) do
  612.                 if v.isVampire then
  613.                     x = x+1
  614.                 end
  615.             end
  616.             if i == 0 or x == i then
  617.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  618.             end
  619.         end,
  620.     },
  621.     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},
  622.         help = [[
  623.     !s or !ss to save position
  624.     !l or l key to load
  625.     !new to new map
  626. ]],
  627.         func = function(self)
  628.             self.save = {}
  629.             for k,v in pairs(tfm.get.room.playerList) do
  630.                eventNewPlayer(k)
  631.             end
  632.             system.disableChatCommandDisplay('ss', true)
  633.             system.disableChatCommandDisplay('s', true)
  634.             system.disableChatCommandDisplay('l', true)
  635.             tfm.exec.disableAutoShaman(true)
  636.             tfm.exec.disableAutoNewGame(true)
  637.             tfm.exec.disableAutoTimeLeft(true)
  638.             tfm.exec.disableAfkDeath(true)
  639.             tfm.exec.newGame(self.maps[math.random(#self.maps)])
  640.         end,
  641.         off = function(self)
  642.             tfm.exec.disableAutoShaman(false)
  643.             tfm.exec.disableAutoNewGame(false)
  644.             tfm.exec.disableAutoTimeLeft(false)
  645.             tfm.exec.disableAfkDeath(false)
  646.             system.disableChatCommandDisplay('ss', false)
  647.             system.disableChatCommandDisplay('s', false)
  648.             system.disableChatCommandDisplay('l', false)
  649.         end,
  650.         eventLoop = function(self, t1, t2)
  651.             if t2<=0 then
  652.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  653.             end
  654.         end,
  655.         eventPlayerDied = function(self, name)
  656.             tfm.exec.respawnPlayer(name)
  657.         end,
  658.         eventPlayerWon = function(self, name)
  659.             tfm.exec.respawnPlayer(name)
  660.         end,
  661.         eventNewPlayer = function(self, name)
  662.             tfm.exec.respawnPlayer(name)
  663.             tfm.exec.bindKeyboard(name,76,true,true)
  664.         end,
  665.         eventNewGame = function(self)
  666.             tfm.exec.setGameTime(300)
  667.             self.save = {}
  668.         end,
  669.         eventChatCommand = function(self, name, msg)
  670.             if msg == 's' or msg == 'ss' then
  671.                 if not self.save[name] then
  672.                     self.save[name] ={}
  673.                 end
  674.                 self.save[name].x = tfm.get.room.playerList[name].x
  675.                 self.save[name].y = tfm.get.room.playerList[name].y
  676.                 self.save[name].cheese = tfm.get.room.playerList[name].hasCheese
  677.             elseif msg == 'l' then
  678.                 if self.save[name] then
  679.                     tfm.exec.movePlayer(name, self.save[name].x, self.save[name].y)
  680.                     if self.save[name].cheese then
  681.                         tfm.exec.giveCheese(name)
  682.                     end
  683.                 end
  684.             elseif msg == 'next' then
  685.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  686.             end
  687.         end,
  688.         eventKeyboard = function(self, name, key, down, x, y)
  689.             if key == 76 then
  690.                 if self.save[name] then
  691.                     tfm.exec.movePlayer(name, self.save[name].x, self.save[name].y, false, 1, 1)
  692.                     if self.save[name].cheese then
  693.                         tfm.exec.giveCheese(name)
  694.                     end
  695.                 end
  696.             end
  697.         end,
  698.     },
  699.     ffa = {name = 'Free for all', author = 'Erikq', 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},
  700.         func = function(self)
  701.             tfm.exec.disableAutoNewGame(true)
  702.             tfm.exec.disableAutoShaman(true)
  703.             self.players={}
  704.             self.toDespawn={}
  705.             for name,player in pairs(tfm.get.room.playerList) do
  706.                 eventNewPlayer(name)
  707.             end
  708.  
  709.             tfm.exec.newGame(self.maps[math.random(#self.maps)])
  710.         end,
  711.         off = function(self)
  712.             tfm.exec.disableAutoNewGame(false)
  713.             tfm.exec.disableAutoShaman(false)
  714.             tfm.exec.newGame()
  715.         end,
  716.         eventNewPlayer = function(self, name)
  717.             for i,key in pairs({32,40,83}) do
  718.                 tfm.exec.bindKeyboard(name,key,true,true)
  719.             end
  720.             self.players[name]={
  721.                 timestamp=os.time(),
  722.                 offsets={x=2, y=10}
  723.             }
  724.         end,
  725.         eventKeyboard = function(self, name,key,down,x,y)
  726.             if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and self.started then
  727.                 if self.players[name].timestamp < os.time()-1000 then
  728.                     local id
  729.                     if tfm.get.room.playerList[name].isFacingRight then
  730.                         id=tfm.exec.addShamanObject(19,x+self.players[name].offsets.x,y+self.players[name].offsets.y)
  731.                     else
  732.                         id=tfm.exec.addShamanObject(20,x+self.players[name].offsets.x,y+self.players[name].offsets.y)
  733.                     end
  734.                     self.players[name].timestamp=os.time()
  735.                     table.insert(self.toDespawn,{os.time(),id})
  736.                 end
  737.             end
  738.         end,
  739.         eventNewGame = function(self)
  740.             self.started=false
  741.         end,
  742.         eventLoop = function (self, t1,t2)
  743.             if t1 >= 3000 and not started then
  744.                 self.started=true
  745.             end
  746.             if t2<=0 then
  747.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  748.             end
  749.             for i,cannon in ipairs(self.toDespawn) do
  750.                 if cannon[1] <= os.time()-3000 then
  751.                     tfm.exec.removeObject(cannon[2])
  752.                     table.remove(self.toDespawn,i)
  753.                 end
  754.             end
  755.         end,
  756.         eventPlayerDied = function(self, name)
  757.             local i=0
  758.             local n
  759.             for pname,player in pairs(tfm.get.room.playerList) do
  760.                 if not player.isDead then
  761.                     i=i+1
  762.                     n=pname
  763.                 end
  764.             end
  765.             if i==0 then
  766.                 tfm.exec.newGame(self.maps[math.random(#self.maps)])
  767.             elseif i==1 then
  768.                 tfm.exec.giveCheese(n)
  769.                 tfm.exec.playerVictory(n)
  770.                 tfm.exec.setGameTime(5)
  771.             end
  772.         end,
  773.     },
  774.     -- own modulese / wlasne moduly
  775.    
  776.    
  777.    
  778.     -- end of own modulese / koniec wlasnych modulów
  779. }
  780.  
  781. ---- sortowanie tablic (skopiowane)
  782. function spairs(t, order)
  783.     -- collect the keys
  784.     local keys = {}
  785.     for k in pairs(t) do keys[#keys+1] = k end
  786.     -- if order function given, sort by it by passing the table and keys a, b,
  787.     -- otherwise just sort the keys
  788.     if order then
  789.         table.sort(keys, function(a,b) return order(t, a, b) end)
  790.     else
  791.         table.sort(keys)
  792.     end
  793.     -- return the iterator function
  794.     local i = 0
  795.     return function()
  796.         i = i + 1
  797.         if keys[i] then
  798.             return keys[i], t[keys[i]]
  799.         end
  800.     end
  801. end
  802.  
  803. -- sparwdzanie czy admin
  804. function isAdmin(nick)
  805.     for key, val in pairs(admins) do
  806.         if val == nick then
  807.             return true
  808.         end
  809.     end
  810.     return false
  811. end
  812.  
  813. ---- sprawdzanie komend
  814. function cmd(com, args, nick)
  815.     if commands[args[1]] then
  816.         if not commands[com].arg2 then
  817.             commands[com].arg2 = commands[com].arg
  818.         end
  819.         if  commands[com].on == 1 and (((#args - 1) >= commands[com].arg and (#args - 1) <= commands[com].arg2) or commands[com].arg == -1) then
  820.             if commands[com].admin == 1 then
  821.                 for key,val in pairs(admins) do
  822.                     if val == nick then
  823.                         commands[com].func(nick, args)
  824.                         return true
  825.                     end
  826.                 end
  827.                 return false
  828.             elseif commands[com].admin == 2 then
  829.                 for key,val in pairs(superAdmin) do
  830.                     if val == nick then
  831.                         commands[com].func(nick, args)
  832.                         return true
  833.                     end
  834.                 end
  835.                 return false
  836.             end
  837.             commands[com].func(nick, args)
  838.             return true
  839.         end
  840.     end
  841.     return false
  842. end
  843.  
  844. ---- BBcode
  845. function bbcode(text)
  846.     text = string.gsub(text, "%[(.?)b%]", "<%1b>")
  847.     text = string.gsub(text, "%[(.?)i%]", "<%1i>")
  848.     text = string.gsub(text, "%[(.?)u%]", "<%1u>")
  849.     text = string.gsub(text, "%[/color%]", "</font>")
  850.     text = string.gsub(text, '%[color=#?(......)%]', '<font color="#%1">')
  851.     return text
  852. end
  853.  
  854. ---- wyswietlanie komunikatów
  855. function message(nick, msg, color)
  856.     local nick2 = nick
  857.     if nick == 'all' then
  858.         nick2 = nil
  859.     end
  860.     if color == 'red' then
  861.         cr = '#CB546B'
  862.     elseif color == 'green' then
  863.         cr = '#2ECF73'
  864.     elseif color == 'blue' then
  865.         cr = '#2F7FCC'
  866.     end
  867.     ui.addTextArea(2, '<font color="'..cr..'">'..msg..'</font>', nick2, 10, 30, 300, 18, nil, nil,0.9)
  868.     timer[nick] = {}
  869.     timer[nick].tim = 4
  870.     timer[nick].make = function() ui.removeTextArea(2, nick2) end
  871. end
  872.  
  873. ---- terazniejszy czas
  874. function time()
  875.     local utc = 2
  876.     local h = math.floor(os.time()/1000%86400/60/60) + utc
  877.     local m = math.floor(os.time()/1000%86400/60%60)
  878.     local s = math.floor(os.time()/1000%86400%60%60)
  879.  
  880.     if h >= 24 then h = h -24 end
  881.     if h < 10 then h = '0'..h end
  882.     if m < 10 then m = '0'..m end
  883.     if s < 10 then s = '0'..s end
  884.     return h..':'..m..':'..s
  885. end
  886.  
  887. ---- licz spacje
  888. function countSpace(nr, text, d, o)
  889.     local xx = nr - string.len(text)
  890.     if d ~= nil then
  891.         xx  = xx/d
  892.     end
  893.     if o ~= nil then
  894.         xx = xx - string.len(o)
  895.     end
  896.     local space = ' '
  897.     for i=2,xx,1 do
  898.         space = space..' '
  899.     end
  900.     return space
  901. end
  902.  
  903. ---- show Help
  904. function showHelp(nick, kx, ky)
  905.     local space = countSpace(48, ' ['..lg.refresh..']['..lg.close..']')
  906.     local text = '<font face="Courier"><font color="#ffffff"><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
  907.     if kx == nil and ky == nil then
  908.         kx, ky = 200, 40
  909.     end
  910.     if module.on == 1 then
  911.         local h = ''
  912.         if modules[module.play].help then
  913.             h = modules[module.play].help
  914.         end
  915.         text = text..'___________________________________________________\n\n<font size="12px"><b>'..lg.minigame..'</b></font> '..modules[module.play].name..'\n\n'..h
  916.     end
  917.     ui.addTextArea(8, text, nick, kx, ky, 400, 300, nil, nil,0.6)
  918.  
  919.  
  920. end
  921.  
  922. ---- Pokaz kolejke map
  923. function showQueue(nick, kx, ky)
  924.     if kx == nil and ky == nil then
  925.         kx, ky = 250, 40
  926.     end
  927.     if settings.queue.on == 0 then
  928.         kolejka = '<font color="#EB1D51">'..lg.disabled..'</font>'
  929.     else
  930.         kolejka = '<VP>'..lg.enabled
  931.     end
  932.     local space = countSpace(38, ' ['..lg.refresh..']['..lg.close..']')
  933.     local napis = '<font face="Courier"><font color="#ffffff"><a href="event:move 1">=</a>'..space..'<a href="event:refresh 1">['..lg.refresh..']</a><a href="event:close">['..lg.close..']</a></font>\n'
  934.     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'
  935.     local x = 1
  936.     for key,val in pairs(maps) do
  937.         if key > mapNumber then
  938.             local space = countSpace(37,x..'. '..maps[key].name..' - '..maps[key].nick..'['..lg.delete..']')           
  939.             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'
  940.             x = x+1
  941.         end
  942.     end
  943.     ui.addTextArea(1, napis, nick, kx, ky, 300, 300, nil, nil,0.6)
  944. end
  945.  
  946. ---- pokaz opcje
  947. function options(nick, kx, ky)
  948.     if kx == nil and ky == nil then
  949.         kx, ky = 10, 40
  950.     end
  951.     local adm = ' '
  952.     local add = ' '
  953.     for key,val in pairs(admins) do
  954.         adm = adm..'<font color="#98E2EB">'..val..'</font>, '
  955.         add = add..val..', '
  956.     end
  957.     local space = countSpace(96 , ' ['..lg.refresh..']['..lg.close..']')
  958.     local space2 = countSpace(95 , lg.admins..':'..add..'  - '..lg.enabled..'    - '..lg.disabled)
  959.     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>
  960. <p align="center"><font size="19px">]]..lg.settings..[[</font></p>]]..[[
  961.  
  962. <font face="Courier">]]..lg.admins..[[:]]..adm..space2..[[<font color="#40B033">¦ - ]]..lg.enabled..[[</font>  <font color="#E33D3D">¦ - ]]..lg.disabled..[[</font></font>
  963. ]]
  964.     local color
  965.     x = 1
  966.     for key,val in spairs(settings) do
  967.         local onOff
  968.         if val.on == 1 then
  969.             color  = '#40B033'
  970.             onOff = '[<a href="event:set off '..key..'"><font color="#E33D3D">'..lg.enable..'</font></a>]'
  971.         else
  972.             color  = '#E33D3D'
  973.             onOff = '[<a href="event:set on '..key..'"><font color="#40B033">'..lg.disable..'</font></a>]'
  974.         end
  975.         if not isAdmin(nick) then onOff = ''end
  976.         local line = onOff..' <font color="'..color..'">'..key..'</font>  - '..val.des..'\n'
  977.        
  978.         text = text..line
  979.        
  980.         x = x+1
  981.     end
  982.     text = text..'\n<font color="#CB546B"><a href="event:stat_reset">['..lg.reset_settings..']</a></font>'
  983.     ui.addTextArea(6, text, nick, kx, ky, 780, 335, 0x424C6B, nil,0.7)
  984. end
  985.  
  986. ---- pokaz liste komend
  987. function showCmd(nick, kx, ky)
  988.     if kx == nil and ky == nil then
  989.         kx, ky = 10, 40
  990.     end
  991.     local adm = ' '
  992.     local add = ' '
  993.     for key,val in pairs(admins) do
  994.         adm = adm..'<font color="#BABD2F">'..val..'</font>, '
  995.         add = add..val..', '
  996.     end
  997.    
  998.     local space = countSpace(96 , ' ['..lg.refresh..']['..lg.close..']')
  999.     local space2 = countSpace(96 , lg.admins..': '..add..'  - '..lg.enabled..'    - '..lg.disabled..'  * - '..lg.for_admins)
  1000.     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>
  1001. <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>]]
  1002.     local text1 = '<font face="Courier">'
  1003.     local text2 = '<font face="Courier">'
  1004.     local color
  1005.     x = 1
  1006.     for key,val in spairs(commands) do
  1007.         local arg = ''
  1008.         local arg2 = ''
  1009.         local star = ' '
  1010.         for i=1, val.arg, 1 do
  1011.             arg = arg..'&lt;arg'..i..'> '
  1012.         end
  1013.         if val.arg2 ~= nil then
  1014.             for i=1, val.arg2 - val.arg, 1 do  
  1015.                 arg2 = arg2..'[arg'..i..'] '
  1016.         end end
  1017.         if val.admin == 1 then
  1018.             star = '<font color="#ED67EA">*</font>'
  1019.         end
  1020.         if val.on == 1 then
  1021.             color  = '#2ECF73'
  1022.         else
  1023.             color  = '#000001'
  1024.         end
  1025.         local line = star..'<font color="'..color..'">!'..key..' '..arg..arg2..'- '..val.des..'</font>\n'
  1026.         if string.len('!'..key..arg..arg2..' - '..val.des) > 47 then
  1027.             x = x+1
  1028.         end
  1029.         if x>22 then
  1030.             text2 = text2..line
  1031.         else   
  1032.             text1 = text1..line
  1033.         end
  1034.         x = x+1
  1035.     end
  1036.     text1 = text1..'</font>'
  1037.     text2 = text2..'</font>'
  1038.  
  1039.     ui.addTextArea(3, text, nick, kx, ky, 780, 335, 0x424C6B, nil,0.9)
  1040.     ui.addTextArea(4, text1, nick, kx, ky+45, 385, 305, 0x000000, nil,0.6)
  1041.     ui.addTextArea(5, text2, nick, kx+395, ky+45, 385, 305, 0x000000, nil,0.6)
  1042. end
  1043.  
  1044. -- pokaz minigry
  1045. function showModules(nick, kx, ky)
  1046.     if kx == nil and ky == nil then
  1047.         kx, ky = 200, 40
  1048.     end
  1049.     local space = countSpace(49 , '  ['..lg.close..']')
  1050.     local text = [[<font face="Courier"><a href="event:move 7">=</a>]]..space..[[<a href="event:close">[]]..lg.close..[[]</a></font>
  1051. <font size="19px"><p align="center">]]..lg.minigames..[[</p></font>
  1052. <font color="#BABD2F">]]..lg.module_stop..[[</font>
  1053.  
  1054.  
  1055. ]]
  1056.     local color
  1057.     x = 1
  1058.     for key,val in spairs(modules) do
  1059.         local author = ''
  1060.         if modules[key].author then
  1061.             author = ' by '..modules[key].author
  1062.         end
  1063.         text = text..'<font color="#40B033"><a href="event:module '..key..'">!module '..key..'</a></font> - '..modules[key].name..author..'\n'
  1064.     end
  1065.     ui.addTextArea(7, text, nick, kx, ky, 400, 335, 0x424C6B, nil, 0.7)
  1066. end
  1067.  
  1068. --
  1069. function modulePlay(nick, name)
  1070.     if commands.module.admin > 0 then
  1071.         if not isAdmin(nick) then
  1072.             return
  1073.         end
  1074.     end
  1075.     module.on = 1
  1076.     module.play = name
  1077.     message('all', lg.minigame..': '..modules[name].name, 'blue')
  1078.     if modules[name].func then
  1079.         modules[name]:func(args)
  1080.     end
  1081.  
  1082. end
  1083.  
  1084. -------- EVENTS --------
  1085. -- nowy gracz
  1086. function eventNewPlayer(nick)
  1087.     if module.on == 1 then
  1088.         -- modules on
  1089.         if modules[module.play].eventNewPlayer then
  1090.             modules[module.play]:eventNewPlayer(nick)
  1091.         end
  1092.     else
  1093.         -- modules off
  1094.        
  1095.     end
  1096.     -- rest
  1097.     ui.addTextArea(0, ' ', nick, 10, 30, 1, 1, 0x56F73D, 0x56F73D, 0.5)
  1098.     system.bindMouse(nick,true)
  1099.     for key,val in pairs({27, 72, 73, 77, 79}) do
  1100.         tfm.exec.bindKeyboard(nick,val,true,true)
  1101.     end
  1102.     for key,val in pairs({72, 73, 77}) do
  1103.         tfm.exec.bindKeyboard(nick,val,false,true)
  1104.     end
  1105.    
  1106. end
  1107.  
  1108.  
  1109.  
  1110. -- eventPlayerDied
  1111. function eventPlayerDied(nick)
  1112.     if module.on == 1 then
  1113.         -- modules on
  1114.         if modules[module.play].eventPlayerDied then
  1115.             modules[module.play]:eventPlayerDied(nick)
  1116.         end
  1117.     else
  1118.         -- modules off
  1119.        
  1120.     end
  1121.     if settings.autorespawn.on == 1 or house ~= nil then
  1122.         tfm.exec.respawnPlayer(nick)
  1123.     end
  1124. end
  1125.  
  1126. -- eventPlayerWon(String playerName)
  1127. function eventPlayerWon(nick)
  1128.     if module.on == 1 then
  1129.         -- modules on
  1130.         if modules[module.play].eventPlayerWon then
  1131.             modules[module.play]:eventPlayerWon(nick)
  1132.         end
  1133.     else
  1134.         -- modules off
  1135.        
  1136.     end
  1137.     if house ~= nil then
  1138.         tfm.exec.respawnPlayer(nick)
  1139.     end
  1140. end
  1141.  
  1142. ---- petla
  1143. function eventLoop(t1, t2)
  1144.     if module.on == 1 then
  1145.         -- modules on
  1146.         if modules[module.play].eventLoop then
  1147.             modules[module.play]:eventLoop(t1, t2)
  1148.         end
  1149.     else
  1150.         -- modules off
  1151.        
  1152.     end
  1153.     if wait ~= 0 then
  1154.         wait = wait -1
  1155.     end
  1156.     -- queue on, nowa mapa
  1157.     if settings.queue.on == 1 and #maps > mapNumber and t2 < t1 and wait == 0 then
  1158.         mapNumber = mapNumber +1
  1159.         if not tfm.exec.newGame(maps[mapNumber].code) then
  1160.             wait = 6
  1161.         end
  1162.     -- wszyscy martwi
  1163.     elseif settings.queue.on == 1 and wait == 0 then
  1164.         local dead = 1
  1165.         for key,val in pairs(tfm.get.room.playerList) do
  1166.             if not tfm.get.room.playerList[key].isDead then
  1167.                 dead = 0
  1168.                 break
  1169.             end
  1170.         end
  1171.         if dead == 1 then
  1172.             if #maps > mapNumber then
  1173.                 mapNumber = mapNumber +1
  1174.                 if not tfm.exec.newGame(maps[mapNumber].code) then
  1175.                     wait = 6
  1176.                 end
  1177.             else
  1178.                 tfm.exec.newGame(0)
  1179.             end
  1180.         end
  1181.     end
  1182.     -- komunikaty
  1183.     for key,val in pairs(timer) do
  1184.         if timer[key].tim == 0 then
  1185.             timer[key].make()
  1186.         else
  1187.             timer[key].tim = timer[key].tim - 1
  1188.         end
  1189.     end
  1190.     -- auto teleportacja
  1191.     for key,val in pairs(playerPosition) do
  1192.         local x = playerPosition[key].x
  1193.         local y = playerPosition[key].y
  1194.         tfm.exec.movePlayer(key, x, y, 0, -1,-1)
  1195.     end
  1196.     -- piesek
  1197.     for key,val in pairs(pet) do   
  1198.         local x = tfm.get.room.playerList[val].x
  1199.         local y = tfm.get.room.playerList[val].y
  1200.         tfm.exec.movePlayer(key, x, y, 0, -1,-1)
  1201.     end
  1202. end
  1203.  
  1204. -- klawiatura
  1205. function eventKeyboard(nick ,key ,down ,x ,y)
  1206.     if module.on == 1 then
  1207.         -- modules on
  1208.         if modules[module.play].eventKeyboard then
  1209.             modules[module.play]:eventKeyboard(nick ,key ,down ,x ,y)
  1210.         end
  1211.     else
  1212.         -- modules off
  1213.        
  1214.     end
  1215.     -- esc
  1216.     if key == 27 then
  1217.         for i=1, 10, 1 do
  1218.             ui.removeTextArea(i, nick)
  1219.         end
  1220.     -- m - modules
  1221.     elseif key == 77 then
  1222.         if down then
  1223.             showModules(nick)
  1224.         else
  1225.             ui.removeTextArea(7, nick)
  1226.         end
  1227.     -- o - opcje
  1228.     elseif key == 79 then
  1229.         options(nick)
  1230.     -- h - help
  1231.     elseif key == 72 then
  1232.         if down then
  1233.             showHelp(nick)
  1234.         else
  1235.             ui.removeTextArea(8, nick)
  1236.         end
  1237.     elseif key == 73 then
  1238.         if down then
  1239.             showCmd(nick)
  1240.         else
  1241.             ui.removeTextArea(3, nick)
  1242.             ui.removeTextArea(4, nick)
  1243.             ui.removeTextArea(5, nick) 
  1244.         end
  1245.     end
  1246. end
  1247.  
  1248. ---- klikniecie
  1249. function eventMouse(nick, x, y)  
  1250.     if module.on == 1 then
  1251.         -- modules on
  1252.         if modules[module.play].eventMouse then
  1253.             modules[module.play]:eventMouse(nick, x, y)
  1254.         end
  1255.     else
  1256.         -- modules off
  1257.        
  1258.     end
  1259.     -- przenoszenie menu
  1260.     if move[nick] ~= nil then
  1261.         if move[nick] == 6 then
  1262.             options(nick, x-8, y-8)
  1263.         elseif move[nick] ==  1 then
  1264.             showQueue(nick, x-8, y-8)
  1265.         elseif move[nick] == 3 then
  1266.             showCmd(nick, x-8, y-8)
  1267.         elseif move[nick] == 8 then
  1268.             showHelp(nick, x-8, y-8)
  1269.         elseif move[nick] == 7 then
  1270.             showModules(nick, x-8, y-8)
  1271.         end
  1272.         move[nick] = nil
  1273.     else
  1274.         -- tp
  1275.         for key,val in pairs(tp) do
  1276.             if key == nick then
  1277.                 tpp[key] = nil
  1278.                 playerPosition[key] = nil
  1279.                 tfm.exec.movePlayer(val, x, y, 0, -1,-1)
  1280.                 break
  1281.             end
  1282.         end
  1283.         -- tpp
  1284.         for key,val in pairs(tpp) do
  1285.             if key == nick then
  1286.                 playerPosition[val] = {}
  1287.                 playerPosition[val].x = x
  1288.                 playerPosition[val].y = y
  1289.                 break
  1290.             end
  1291.         end
  1292.     end
  1293. end
  1294. function name(i, nick)
  1295.     if #args < (i+1) then
  1296.         return nick
  1297.     else
  1298.         return args[i+1]
  1299.     end
  1300. end
  1301. ---- !komendy
  1302. function eventChatCommand(nick, msg)
  1303.     if module.on == 1 then
  1304.         -- modules on
  1305.         if modules[module.play].eventChatCommand then
  1306.             modules[module.play]:eventChatCommand(nick, msg)
  1307.         end
  1308.     else
  1309.         -- modules off
  1310.        
  1311.     end
  1312.     -- log
  1313.     Log = '['..time()..'] '..nick..' - !'..msg..'\n'..Log
  1314.     -- dzielenie argumentów
  1315.     local args={}
  1316.     for arg in msg:gmatch("[^%s]+") do
  1317.         table.insert(args,arg)
  1318.     end
  1319.     rest = msg:match("%s(.*)") or ""
  1320.     -- wylaczenie dostepu dla tych z banem
  1321.     for key,val in pairs(ban) do
  1322.         for k,v in pairs(superAdmin) do
  1323.             if key == nick and val == true and nick ~= v then
  1324.                 message(nick, lg.banned, 'red')
  1325.                 return false
  1326.             end
  1327.         end
  1328.     end
  1329.     function name(i)
  1330.         if #args < (i+1) then
  1331.             return nick
  1332.         else
  1333.             return args[i+1]
  1334.         end
  1335.     end
  1336.     -------------
  1337.     cmd(args[1], args, nick)
  1338.    
  1339. end
  1340.  
  1341. ---- odwolania z <a>
  1342. function eventTextAreaCallback(id, nick, callback)
  1343.     if module.on == 1 then
  1344.         -- modules on
  1345.         if modules[module.play].eventTextAreaCallback then
  1346.             modules[module.play]:eventTextAreaCallback(id, nick, callback)
  1347.         end
  1348.     else
  1349.         -- modules off
  1350.        
  1351.     end
  1352.     local args={}
  1353.     for arg in callback:gmatch("[^%s]+") do
  1354.         table.insert(args,arg)
  1355.     end
  1356.     -- zamykanie
  1357.     if callback == 'close' then
  1358.         if id == 3 then
  1359.             ui.removeTextArea(3, nick)
  1360.             ui.removeTextArea(4, nick)
  1361.             ui.removeTextArea(5, nick)
  1362.         else
  1363.             ui.removeTextArea(id, nick)
  1364.         end
  1365.     -- odswiezanie
  1366.     elseif args[1] == 'refresh' then
  1367.         if id == 1 then
  1368.             showQueue(nick)
  1369.         elseif id == 6 then
  1370.             options(nick)
  1371.         end
  1372.     -- ustawienia
  1373.     elseif args[1] == 'set' then
  1374.         if args[2] ==  'on' then
  1375.             settings[args[3]].on = 1
  1376.             settings[args[3]].fOn()
  1377.         else
  1378.             settings[args[3]].on = 0
  1379.             settings[args[3]].fOff()
  1380.         end
  1381.         options(nick)
  1382.     -- przenoszenie textarea
  1383.     elseif args[1] == 'move' then
  1384.         move[nick] = id
  1385.     -- resetowanie ustawien
  1386.     elseif args[1] == 'stat_reset' then
  1387.         for key,val in pairs(settings) do
  1388.             settings[key].on = settings[key].def
  1389.         end
  1390.         options(nick)
  1391.     -- !maps usuwanie
  1392.     elseif args[1] == 'delmap' then
  1393.         if isAdmin(nick) then
  1394.             table.remove(maps, args[2])
  1395.             showQueue(nick)
  1396.         end
  1397.     -- moduly
  1398.     elseif args[1] == 'module' then
  1399.         modulePlay(nick, args[2])  
  1400.     end
  1401. end
  1402.  
  1403. function eventEmotePlayed(nick, emoteId)
  1404.     if module.on == 1 then
  1405.         -- modules on
  1406.         if modules[module.play].eventEmotePlayed then
  1407.             modules[module.play]:eventEmotePlayed(nick, emoteId)
  1408.         end
  1409.     else
  1410.         -- modules off
  1411.        
  1412.     end
  1413. end
  1414.  
  1415. function eventPlayerGetCheese(nick)
  1416.     if module.on == 1 then
  1417.         -- modules on
  1418.         if modules[module.play].eventPlayerGetCheese then
  1419.             modules[module.play]:eventPlayerGetCheese(nick)
  1420.         end
  1421.     else
  1422.         -- modules off
  1423.        
  1424.     end
  1425. end
  1426.  
  1427. function eventPlayerLeft(nick)
  1428.     if module.on == 1 then
  1429.         -- modules on
  1430.         if modules[module.play].eventPlayerLeft then
  1431.             modules[module.play]:eventPlayerLeft(nick)
  1432.         end
  1433.     else
  1434.         -- modules off
  1435.        
  1436.     end
  1437. end
  1438.  
  1439. function eventPlayerVampire(nick)
  1440.     if module.on == 1 then
  1441.         -- modules on
  1442.         if modules[module.play].eventPlayerVampire then
  1443.             modules[module.play]:eventPlayerVampire(nick)
  1444.         end
  1445.     else
  1446.         -- modules off
  1447.        
  1448.     end
  1449. end
  1450.  
  1451. function eventPlayerWon(nick)
  1452.     if module.on == 1 then
  1453.         -- modules on
  1454.         if modules[module.play].eventPlayerWon then
  1455.             modules[module.play]:eventPlayerWon(nick)
  1456.         end
  1457.     else
  1458.         -- modules off
  1459.        
  1460.     end
  1461. end
  1462.  
  1463. function eventPlayerRespawn(nick)
  1464.     if module.on == 1 then
  1465.         -- modules on
  1466.         if modules[module.play].eventPlayerRespawn then
  1467.             modules[module.play]:eventPlayerRespawn(nick)
  1468.         end
  1469.     else
  1470.         -- modules off
  1471.        
  1472.     end
  1473. end
  1474.  
  1475. function eventPopupAnswer(id, nick, answer)
  1476.     if module.on == 1 then
  1477.         -- modules on
  1478.         if modules[module.play].eventPopupAnswer then
  1479.             modules[module.play]:eventPopupAnswer(id, nick, answer)
  1480.         end
  1481.     else
  1482.         -- modules off
  1483.        
  1484.     end
  1485. end
  1486.  
  1487. function eventSummoningStart(nick, objectType, x, y, angle)
  1488.     if module.on == 1 then
  1489.         -- modules on
  1490.         if modules[module.play].eventSummoningStart then
  1491.             modules[module.play]:eventSummoningStart(nick, objectType, x, y, angle)
  1492.         end
  1493.     else
  1494.         -- modules off
  1495.        
  1496.     end
  1497. end
  1498.  
  1499. function eventSummoningCancel(nick)
  1500.     if module.on == 1 then
  1501.         -- modules on
  1502.         if modules[module.play].eventSummoningCancel then
  1503.             modules[module.play]:eventSummoningCancel(nick)
  1504.         end
  1505.     else
  1506.         -- modules off
  1507.        
  1508.     end
  1509. end
  1510.  
  1511. function eventSummoningEnd(nick, objectType, x, y, angle, xSpeed, ySpeed, objectType, other)
  1512.     if module.on == 1 then
  1513.         -- modules on
  1514.         if modules[module.play].eventSummoningEnd then
  1515.             modules[module.play]:eventSummoningEnd(nick, objectType, x, y, angle, xSpeed, ySpeed, objectType, other)
  1516.         end
  1517.     else
  1518.         -- modules off
  1519.        
  1520.     end
  1521. end
  1522.  
  1523. function eventNewGame()
  1524.     if module.on == 1 then
  1525.         -- modules on
  1526.         if modules[module.play].eventNewGame then
  1527.             modules[module.play]:eventNewGame()
  1528.         end
  1529.     else
  1530.         -- modules off
  1531.        
  1532.     end
  1533. end
  1534.  
  1535. -- wylaczenie widzialnosci komend
  1536. for k,v in pairs(commands) do
  1537. system.disableChatCommandDisplay(k, true)
  1538. end
  1539.  
  1540. -- wymuszenie nowego gracza
  1541. for playername,player in pairs(tfm.get.room.playerList) do
  1542.    eventNewPlayer(playername)
  1543. end
  1544.  
  1545. print '<R>[SYSTEM]</R>Tribe comand'
  1546.  
  1547. ---- koniec skryptu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement