Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- superAdmin = {'Erikq'}
- admins = {'Iulianbuhai', 'Pufulinaa', 'Inffernape', 'Cristianorod', 'Erikq'}
- language = 'ro' -- 'en' or 'ro'
- version = '1.6'
- lang = {}
- lang.ro = {
- 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:
- !cmd - se activeaza comanda
- !set - setari
- !help - ajutor
- comenzi pe tastatura:
- h - ajutor
- Esc - iesi din tabel
- i - comenzi
- o - setari
- m - minijocuri
- ]],
- disabled = 'Off',
- enabled = 'On',
- disable = 'dezactivat',
- enable = 'activat',
- refresh = 'reimprospatare',
- close = 'inchide',
- minigame = 'Minijoc',
- minigames = 'Minijocuri',
- module_stop = '!module stop - dezactivezi minijocul',
- maps_queue = 'Harti in asteptare',
- queuing = 'Asteptare',
- played = 'a jucat',
- maps2 = 'map',
- delete = 'sterge',
- admins = 'Admins',
- reset_settings = 'resetare setari',
- settings = 'Setarile',
- commands = 'Comenzi',
- for_admins = 'Admin',
- banned = 'Interzis',
- a = '',
- a = '',
- module_des = ':Lista cu minijocuri',
- made_des = 'nou (se lucreaza..)',
- kill_des = 'Mori',
- ice_des = 'cheata',
- sham_des = 'shaman',
- ch_des = 'branza',
- tp_des = 'teleportare',
- utp_des = 'teleportare cu lipici dezactivat [unglue player]',
- tpp_des = 'teleportare cu lipici',
- re_des = 'sterge toate obiectele [Shaman]',
- meep_des = 'activeaza meep',
- ban_des = 'Dezactiveaza comanda <nick>',
- unban_des = 'Activeaza inapoi comanda <nick>',
- admin_des = 'Add admins',
- unadmin_des = 'sterge adminu <nick>',
- score_des = 'scor Ex: !score nume cifra',
- mapname_des = 'Modifica numele de la mapa',
- shamname_des = 'Modifica numele de la shaman',
- respawn_des = 'respawn',
- autorespawn_des = 'On/Off respawn',
- datl_des = 'On/Off time',
- color_des = 'culoare nume : Ex:!color Nume ffffff',
- queue_des = 'on/off maps queuing',
- maps_des = 'arata hartile in coada',
- np_des = 'adaugi o harta',
- npp_des = 'adauga o harta in coada',
- mort_des = 'omoaral pe cineva',
- off_des = 'inchide comenzile',
- on_des = 'porneste comenzile',
- cmd_des = 'lista cu comenzi',
- pet_des = 'se transforma in animal de companie <arg1>',
- unpet = 'dezactiveaza !pet',
- set_des = 'Arata setarile',
- xml_des = 'Incarca o harta in XML',
- house_des = 'Stabileste coliba tribal',
- help_des = 'ajutor',
- vampire_des = 'Te transformi intr-un vampir',
- log_des = 'istoric actiuni',
- queue_set = 'mapa in asteptare',
- autorespawn_set = 'respawn automat',
- autoTimeLeft_set = 'autoTimeLeft',
- afk_set = 'dezactiveaza AFK',
- autoNewGame_set = 'auto map change',
- autoScore_set = 'auto score',
- autoShaman_set = 'automat shaman',
- shamanSkills_set = 'activeaza noile puteri',
- settime_des = 'timpul',
- snow_des = 'ninge!!',
- _des = '',
- _des = '',
- _des = '',
- }
- lang.en = {
- 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:
- !cmd - shows commands
- !set - shows settings
- !help - shows help
- Hotkeys:
- h - shows help
- Esc - closes window
- i - shows commands
- o - shows settings
- m - shows minigames
- ]],
- disabled = 'Off',
- enabled = 'On',
- disable = 'disable',
- enable = 'enable',
- refresh = 'refresh',
- close = 'close',
- minigames = 'Minigames',
- minigame = 'Minigame',
- module_stop = '!module stop - to turn off minigame',
- maps_queue = 'Maps queue',
- queuing = 'Queuing',
- played = 'played',
- maps2 = 'maps',
- delete = 'delete',
- admins = 'Admins',
- reset_settings = 'reset settings',
- settings = 'Settings',
- commands = 'Commands',
- for_admins = 'Admins',
- banned = 'You are banned',
- module_des = 'shows list of minigames',
- made_des = 'new commend',
- kill_des = 'kills',
- ice_des = 'freezes',
- sham_des = 'gives shaman',
- ch_des = 'gives cheese',
- tp_des = 'teleport',
- utp_des = 'diesables teleport, [unglue player]',
- tpp_des = 'teleport with glue',
- re_des = 'removes all objects',
- meep_des = 'gives meep',
- ban_des = 'disables commands for <name>',
- unban_des = 'enables commands for <name>',
- admin_des = 'gives admin rank',
- unadmin_des = 'withdraws admin rank',
- score_des = 'sets <player> score',
- mapname_des = 'changes map name',
- shamname_des = 'changes shaman name',
- respawn_des = 'respawns',
- autorespawn_des = 'on/off autorespawn',
- color_des = 'sets nickname color',
- queue_des = 'on/off maps queuing',
- maps_des = 'queuing',
- np_des = 'plays map',
- npp_des = 'adds map to queue',
- mort_des = 'kill yourself',
- off_des = 'disables command',
- on_des = 'enables command',
- cmd_des = 'shows commands list',
- pet_des = 'converts <name> into pet',
- unpet = 'withdraws !pet',
- set_des = 'shows settings lists',
- xml_des = 'plays map from xml code',
- house_des = 'sets tribe house',
- help_des = 'shows help',
- vampire_des = 'turns into vampire',
- log_des = 'shows !commands log',
- queue_set = 'maps queuing',
- autorespawn_set = 'auto respwan',
- autoTimeLeft_set = 'automatic time change',
- afk_set = 'AFK death',
- autoNewGame_set = 'auto map change',
- autoScore_set = 'auto score',
- autoShaman_set = 'automatic selection of Shaman',
- shamanSkills_set = 'shaman skills',
- settime_des = 'sets game time',
- snow_des = 'toggles snow',
- _des = '',
- _des = '',
- _des = '',
- }
- lg = lang[language]
- mapNumber = 0
- wait = 0
- Log = '\n'
- tp = {}
- tpp = {}
- playerPosition = {}
- ban = {}
- maps = {}
- ob = {}
- timer = {}
- pet = {}
- move = {}
- xml = {}
- vote = {}
- fly = false
- commands = {
- kill = {on = 1, admin = 1, arg = 0, arg2 = 1, des = lg.kill_des, func = function(nick, args)
- tfm.exec.killPlayer(name(1))
- end},
- ice = {on = 1, admin = 1, arg = 1, des = lg.ice_des, func = function(nick, args)
- if tfm.get.room.playerList[args[2]] then
- local y = tfm.get.room.playerList[args[2]].y
- local x = tfm.get.room.playerList[args[2]].x
- tfm.exec.addShamanObject(54, x, y, 0, 0, 0, false)
- tfm.exec.killPlayer(args[2])
- end
- end},
- sham = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.sham_des, func = function(nick, args)
- tfm.exec.setShaman(name(1))
- print("<b><R>[SYSTEM]</R></b><BV>Sa transformat un shaman[!log]</BV>")
- end},
- ch = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.ch_des, func = function(nick, args)
- tfm.exec.giveCheese(name(1))
- print("<b><R>[SYSTEM]</R></b><BV>Branza[!log]</BV>")
- end},
- tp = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.tp_des, func = function(nick, args)
- system.bindMouse(nick,true)
- tpp[nick] = nil
- tp[nick] = args[2]
- print("<b><R>[SYSTEM]</R></b><BV>Sa activat tp [!log]</BV>")
- end},
- tpp = {on = 1, admin = 0, arg = 0, arg = 1, des = lg.tpp_des, func = function(nick, args)
- system.bindMouse(nick,true)
- tp[nick] = nil
- tpp[nick] = args[2]
- print("<b><R>[SYSTEM]</R></b><BV>Sa activat tpp(lipici)[!log]</BV>")
- end},
- utp = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.utp_des, func = function(nick, args)
- playerPosition[name(1)] = nil
- tpp[nick] = nil
- tp[nick] = nil
- playerPosition[nick] = nil
- print("<b><R>[SYSTEM]</R></b><BV>A dezactivat tpp[!log]</BV>")
- end},
- re = {on = 1, admin = 1, arg = 0, des = lg.re_des, func = function(nick, args)
- for key,val in pairs(tfm.get.room.objectList) do
- table.insert(ob, key)
- end
- for key,val in pairs(ob) do
- tfm.exec.removeObject(val)
- end
- ob = {}
- print("<b><R>[SYSTEM]</R></b><BV>A sters obiectele shaman[!log]</BV>")
- end},
- meep = {on = 1, admin = 0, arg = 1, des = lg.meep_des, func = function(nick, args)
- tfm.exec.giveMeep(args[2])
- print("<b><R>[SYSTEM]</R></b><BV>Meep activat de:[!log]</BV>")
- end},
- ban = {on = 1, admin = 1, arg = 1, des = lg.ban_des, func = function(nick, args)
- ban[args[2]] = true
- print("<b><R>[SYSTEM]</R></b><BV>Cineva a fost banat[!log]</BV>")
- end},
- unban = {on = 1, admin = 1, arg = 1, des = lg.unban_des, func = function(nick, args)
- ban[args[2]] = false
- print("<b><R>[SYSTEM]</R></b><BV>Cineva a primit unban[!log]</BV>")
- end},
- admin = {on = 1, admin = 1, arg = 1, des = lg.admin_des, func = function(nick, args)
- table.insert(admins, args[2])
- print("<b><R>[SYSTEM]</R></b><BV>Cineva a pus administrator[!log]</BV>")
- end},
- unadmin = {on = 1, admin = 2, arg = 1, des = lg.unadmin_des, func = function(nick, args)
- for i=1,#admins,1 do
- if admins[i] == args[2] then
- table.remove(admins, i)
- end
- end
- print("<b><R>[SYSTEM]</R></b><BV>A sters un administrator[!log]</BV>")
- end},
- score = {on = 1, admin = 0, arg = 1, arg2 = 2, des = lg.score_des, func = function(nick, args)
- tfm.exec.setPlayerScore(args[2], args[3], 0)
- print("<b><R>[SYSTEM]</R></b><BV>Scor activat[!log]</BV>")
- end},
- mapname = {on = 1, admin = 0, arg = -1, des = lg.mapname_des, func = function(nick, args)
- tfm.exec.setUIMapName(bbcode(rest))
- print("<b><R>[SYSTEM]</R></b><BV>A schimbat numele de la mapa[!log]</BV>")
- end},
- shamname = {on = 1, admin = 0, arg = -1, des = lg.shamname_des, func = function(nick, args)
- tfm.exec.setUIShamanName(bbcode(rest))
- print("<b><R>[SYSTEM]</R></b><BV>A schimbat numele de la shaman :[!log]</BV>")
- end},
- respawn = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.respawn_des, func = function(nick, args)
- tfm.exec.respawnPlayer(name(1))
- print("<b><R>[SYSTEM]</R></b><BV>Respawn activat[!log]</BV>")
- end},
- autorespawn = {on = 1, admin = 0, arg = 1, des = lg.autorespawn_des, func = function(nick, args)
- if args[2] == 'off' then
- settings.autorespawn.on = 0
- else
- settings.autorespawn.on = 1
- end
- print("<b><R>[SYSTEM]</R></b><BV>Autorespawn...[!log]</BV>")
- end},
- color = {on = 1, admin = 0, arg = 1, arg = 2, des = lg.color_des, func = function(nick, args)
- tfm.exec.setNameColor(args[2],'0x'..args[3])
- print("<b><R>[SYSTEM]</R></b><BV>color adaugat de :[!log]</BV>")
- end},
- queue = {on = 1, admin = 0, arg = 1, des = lg.queue_des, func = function(nick, args)
- if args[2] == 'off' then
- settings.queue.on = 0
- tfm.exec.disableAutoNewGame(false)
- else
- settings.queue.on = 1
- tfm.exec.disableAutoNewGame(true)
- message('all', 'Wlaczono kolejkowanie', 'green')
- end
- print("<b><R>[SYSTEM]</R></b><BV>Activat[!log]</BV>")
- end},
- maps = {on = 1, admin = 0, arg = 0, des = lg.maps_des, func = function(nick, args)
- showQueue(nick)
- print("<b><R>[SYSTEM]</R></b><BV>Activat[!log]</BV>")
- end},
- np = {on = 1, admin = 0, arg = 1, des = lg.np_des, func = function(nick, args)
- tfm.exec.newGame(args[2])
- print("<b><R>[SYSTEM]</R></b><BV>Activat[!log]</BV>")
- end},
- npp = {on = 1, admin = 0, arg = 1, des = lg.npp_des, func = function(nick, args)
- if #maps - mapNumber == 17 then
- message(nick, 'Nie mozesz dodac wiecej map', 'red')
- else
- local code = args[2]
- if args[2] == 'xml' then
- if not xml[nick] then
- return false
- end
- code = xml[nick].xml
- end
- local mapNr = #maps+1;
- maps[mapNr] = {}
- maps[mapNr].code = code
- maps[mapNr].name = args[2]
- maps[mapNr].nick = nick
- end
- print("<b><R>[SYSTEM]</R></b><BV>A bagat un cod in asteptare[!log]</BV>")
- end},
- meep = {on = 1, admin = 0, arg = 0, des = lg.meep_des, func = function(nick, args)
- tfm.exec.giveMeep(nick)
- print("<b><R>[SYSTEM]</R></b><BV>Meep activat[!log]</BV>")
- end},
- mort = {on = 1, admin = 0, arg = 0, des = lg.mort_des, func = function(nick, args)
- tfm.exec.killPlayer(nick)
- print("<b><R>[SYSTEM]</R></b><BV>A murit[!log]</BV>")
- end},
- off = {on = 1, admin = 1, arg = 1, des = lg.off_des, func = function(nick, args)
- if args[2] == 'off' or args[2] == 'on' then
- elseif not commands[args[2]] then
- message(nick, 'Nie ma takiej komendy', 'red')
- else
- commands[args[2]].on = 0
- message(nick, 'Wylaczono "'..args[2]..'"', 'green')
- end
- print("<b><R>[SYSTEM]</R></b><BV>a oprit comenzile[!log]</BV>")
- end},
- on = {on = 1, admin = 1, arg = 1, des = lg.on_des, func = function(nick, args)
- if not commands[args[2]] then
- message(nick, 'Nie ma takiej komendy', 'red')
- else
- commands[args[2]].on = 1
- message(nick, 'Wlaczono "'..args[2]..'"', 'green')
- end
- print("<b><R>[SYSTEM]</R></b><BV>A pornit comenzile[!log]</BV>")
- end},
- cmd = {on = 1, admin = 0, arg = 0, des = lg.cmd_des, func = function(nick, args)
- showCmd(nick)
- print("<b><R>[SYSTEM]</R></b><BV>Un soarece a pornit comanda[!log]</BV>")
- end},
- pet = {on = 1, admin = 1, arg = 1, des = lg.pet_des, func = function(nick, args)
- pet[args[2]] = nick
- print("<b><R>[SYSTEM]</R></b><BV>A activat ca animal de companie[!log]</BV>")
- end},
- unpet = {on = 1, admin = 1, arg = 1, des = lg.unpet,func = function(nick, args)
- pet[args[2]] = nil
- print("<b><R>[SYSTEM]</R></b><BV>A dezactivat[!log]</BV>")
- end},
- set = {on = 1, admin = 0, arg = 0, des = lg.set_des, func = function(nick, args)
- options(nick)
- print("<b><R>[SYSTEM]</R></b><BV>A activat setarile[!log]</BV>")
- end},
- xml = {on = 1, admin = 0, arg = -1, des = lg.xml_des, func = function(nick, args)
- if args[2] == 'start' then
- xml[nick] = {}
- xml[nick].f = 1
- xml[nick].xml = ' '
- elseif args[2] == 'play' then
- if xml[nick] ~= nil then
- tfm.exec.newGame(xml[nick].xml)
- end
- elseif xml[nick] ~= nil then
- if xml[nick].f == 1 then
- xml[nick].xml = string.gsub(rest, "<", "<")
- xml[nick].f = 0
- else
- xml[nick].xml = xml[nick].xml..string.gsub(rest, "<", "<")
- end
- end
- end},
- house = {on = 1, admin = 0, arg = 1, des = lg.house_des, func = function(nick, args)
- if args[2] == 'off' then
- house = nil
- tfm.exec.disableAfkDeath(false)
- tfm.exec.disableAutoShaman(false)
- tfm.exec.disableAutoNewGame(false)
- else
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- if args[2] == 'xml' then
- house = xml[nick]
- tfm.exec.newGame(xml[nick])
- else
- house = args[2]
- tfm.exec.newGame(args[2])
- end
- end
- print("<b><R>[SYSTEM]</R></b><BV>None[!log]</BV>")
- end},
- help = {on = 1, admin = 0, arg = 0, des = lg.help_des, func = function(nick, args)
- showHelp(nick)
- print("<b><R>[SYSTEM]</R></b><BV>A pornit comanda !help[!log]</BV>")
- end},
- vampire = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.vampire_des, func = function(nick, args)
- tfm.exec.setVampirePlayer(name(1))
- print("<b><R>[SYSTEM]</R></b><BV>Cineva e vampir[!log]</BV>")
- end},
- log = {on = 1, admin = 1, arg = 0, arg2 = 0, des = lg.log_des, func = function(nick, args)
- ui.addTextArea(3, Log:sub(1, 2000), nick, 250, 40, 300, 335, nil, nil,0.7)
- print("<b><R>[SYSTEM]</R></b><BV>Log pornit sa vad istoric actiuni[!log]</BV>")
- end},
- module = {on = 1, admin = 0, arg = 0, arg2 = 1, des = lg.module_des, func = function(nick, args)
- if not args[2] then
- showModules(nick)
- elseif module.on == 1 and (args[2] == 'stop' or args[2] == 'off')and isAdmin(nick) then
- if modules[module.play].off then
- modules[module.play]:off(args)
- end
- module.on = 0
- module.play = ''
- elseif isAdmin(nick) and modules[args[2]] then
- modulePlay(nick, args[2])
- end
- print("<b><R>[SYSTEM]</R></b><BV>Module pornit[!log]</BV>")
- end},
- settime = {on = 1, admin = 1, arg = 1, des = lg.settime_des, func = function(nick, args)
- tfm.exec.setGameTime(args[2])
- print("<b><R>[SYSTEM]</R></b><BV>Timpul modificat[!log]</BV>")
- end},
- snow = {on = 1, admin = 0, arg = 0, des = lg.snow_des, func = function(nick, args)
- tfm.exec.snow()
- print("<b><R>[SYSTEM]</R></b><BV>Zapada 1.07 min[!log]</BV>")
- end},
- -- own commands / wlasne komendy
- -- end of own commands / koniec wlasnych komend
- }
- settings = {
- queue = {on = 0, def = 0,
- des = lg.queue_set,
- fOn = function() end,
- fOff = function() end},
- autorespawn = {on = 0, def = 0,
- des = lg.autorespawn_set,
- fOn = function() end,
- fOff = function() end},
- autoTimeLeft = {on = 0, def = 0,
- des = lg.autoTimeLeft_set,
- fOn = function() tfm.exec.disableAutoTimeLeft(false) end,
- fOff = function() tfm.exec.disableAutoTimeLeft(true) end},
- afk = {on = 1, def = 0,
- des = lg.afk_set,
- fOn = function() tfm.exec.disableAfkDeath(false) end,
- fOff = function() tfm.exec.disableAfkDeath(true) end},
- autoNewGame = {on = 1, def = 1,
- des = lg.autoNewGame_set,
- fOn = function() tfm.exec.disableAutoNewGame(false) end,
- fOff = function() tfm.exec.disableAutoNewGame(true) end},
- autoScore = {on = 1, def = 1,
- des = lg.autoScore_set,
- fOn = function() tfm.exec.disableAutoScore(false) end,
- fOff = function() tfm.exec.disableAutoScore(true) end},
- autoShaman = {on = 1, def = 1,
- des = lg.autoShaman_set,
- fOn = function() tfm.exec.disableAutoShaman(false) end,
- fOff = function() tfm.exec.disableAutoShaman(true) end},
- shamanSkills = {on = 1, def = 1,
- des = lg.shamanSkills_set,
- fOn = function() tfm.exec.disableAllShamanSkills(false) end,
- fOff = function() tfm.exec.disableAllShamanSkills(true) end},
- -- own settings / wlasne ustawienia
- -- end of own settings / koniec wlasnych ustawien
- }
- -- moduly
- module = {on = 0, play = ''}
- modules = {
- racing = {name = 'Racing''normal'
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- end,
- off = function(self)
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(false)
- end,
- eventLoop = function(self, t1, t2)
- if self.mode == 'drunk' then
- if math.random(5) == 1 then
- for key,val in pairs(tfm.get.room.playerList) do
- x = math.random(-50, 50)
- if x ~= 0 then
- tfm.exec.movePlayer(key, 0, 0, true, math.random(-50, 50), 0, true)
- end
- end
- end
- end
- if t2<=0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- eventPlayerWon = function(self, name)
- local i=0
- for k,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- i=i+1
- end
- end
- if i==0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- eventPlayerDied = function(self, name)
- local i=0
- for k,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- i=i+1
- end
- end
- if i==0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- eventChatCommand = function(self, name, msg)
- if msg == 'mode drunk' then
- self.mode = 'drunk'
- elseif msg == 'mode normal' then
- self.mode = 'normal'
- end
- end,
- eventNewGame = function(self)
- tfm.exec.setGameTime(63)
- end
- },
- 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},
- func = function(self)
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- tfm.exec.disableAutoNewGame(true)
- end,
- off = function(self)
- tfm.exec.disableAutoNewGame(false)
- end,
- eventLoop = function(self, t1, t2)
- if t2<=0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- eventPlayerDied = function(self, name)
- local i=0
- for k,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- i=i+1
- end
- end
- if i==0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- },
- 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},
- func = function(self)
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- tfm.exec.disableAutoNewGame(true)
- end,
- off = function(self)
- tfm.exec.disableAutoNewGame(false)
- end,
- eventLoop = function(self, t1, t2)
- if t2<=0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- local i=0
- for k,v in pairs(tfm.get.room.playerList) do
- if not v.isDead then
- i = i+1
- end
- end
- local x = 0
- for k,v in pairs(tfm.get.room.playerList) do
- if v.isVampire then
- x = x+1
- end
- end
- if i == 0 or x == i then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- },
- 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},
- help = [[
- !s or !ss to save position
- !l or l key to load
- !new to new map
- ]],
- func = function(self)
- self.save = {}
- for k,v in pairs(tfm.get.room.playerList) do
- eventNewPlayer(k)
- end
- system.disableChatCommandDisplay('ss', true)
- system.disableChatCommandDisplay('s', true)
- system.disableChatCommandDisplay('l', true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end,
- off = function(self)
- tfm.exec.disableAutoShaman(false)
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.disableAutoTimeLeft(false)
- tfm.exec.disableAfkDeath(false)
- system.disableChatCommandDisplay('ss', false)
- system.disableChatCommandDisplay('s', false)
- system.disableChatCommandDisplay('l', false)
- end,
- eventLoop = function(self, t1, t2)
- if t2<=0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- eventPlayerDied = function(self, name)
- tfm.exec.respawnPlayer(name)
- end,
- eventPlayerWon = function(self, name)
- tfm.exec.respawnPlayer(name)
- end,
- eventNewPlayer = function(self, name)
- tfm.exec.respawnPlayer(name)
- tfm.exec.bindKeyboard(name,76,true,true)
- end,
- eventNewGame = function(self)
- tfm.exec.setGameTime(300)
- self.save = {}
- end,
- eventChatCommand = function(self, name, msg)
- if msg == 's' or msg == 'ss' then
- if not self.save[name] then
- self.save[name] ={}
- end
- self.save[name].x = tfm.get.room.playerList[name].x
- self.save[name].y = tfm.get.room.playerList[name].y
- self.save[name].cheese = tfm.get.room.playerList[name].hasCheese
- elseif msg == 'l' then
- if self.save[name] then
- tfm.exec.movePlayer(name, self.save[name].x, self.save[name].y)
- if self.save[name].cheese then
- tfm.exec.giveCheese(name)
- end
- end
- elseif msg == 'next' then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- end,
- eventKeyboard = function(self, name, key, down, x, y)
- if key == 76 then
- if self.save[name] then
- tfm.exec.movePlayer(name, self.save[name].x, self.save[name].y, false, 1, 1)
- if self.save[name].cheese then
- tfm.exec.giveCheese(name)
- end
- end
- end
- end,
- },
- 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},
- func = function(self)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- self.players={}
- self.toDespawn={}
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end,
- off = function(self)
- tfm.exec.disableAutoNewGame(false)
- tfm.exec.disableAutoShaman(false)
- tfm.exec.newGame()
- end,
- eventNewPlayer = function(self, name)
- for i,key in pairs({32,40,83}) do
- tfm.exec.bindKeyboard(name,key,true,true)
- end
- self.players[name]={
- timestamp=os.time(),
- offsets={x=2, y=10}
- }
- end,
- eventKeyboard = function(self, name,key,down,x,y)
- if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and self.started then
- if self.players[name].timestamp < os.time()-1000 then
- local id
- if tfm.get.room.playerList[name].isFacingRight then
- id=tfm.exec.addShamanObject(19,x+self.players[name].offsets.x,y+self.players[name].offsets.y)
- else
- id=tfm.exec.addShamanObject(20,x+self.players[name].offsets.x,y+self.players[name].offsets.y)
- end
- self.players[name].timestamp=os.time()
- table.insert(self.toDespawn,{os.time(),id})
- end
- end
- end,
- eventNewGame = function(self)
- self.started=false
- end,
- eventLoop = function (self, t1,t2)
- if t1 >= 3000 and not started then
- self.started=true
- end
- if t2<=0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- end
- for i,cannon in ipairs(self.toDespawn) do
- if cannon[1] <= os.time()-3000 then
- tfm.exec.removeObject(cannon[2])
- table.remove(self.toDespawn,i)
- end
- end
- end,
- eventPlayerDied = function(self, name)
- local i=0
- local n
- for pname,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- n=pname
- end
- end
- if i==0 then
- tfm.exec.newGame(self.maps[math.random(#self.maps)])
- elseif i==1 then
- tfm.exec.giveCheese(n)
- tfm.exec.playerVictory(n)
- tfm.exec.setGameTime(5)
- end
- end,
- },
- -- own modulese / wlasne moduly
- -- end of own modulese / koniec wlasnych modulów
- }
- ---- sortowanie tablic (skopiowane)
- function spairs(t, order)
- -- collect the keys
- local keys = {}
- for k in pairs(t) do keys[#keys+1] = k end
- -- if order function given, sort by it by passing the table and keys a, b,
- -- otherwise just sort the keys
- if order then
- table.sort(keys, function(a,b) return order(t, a, b) end)
- else
- table.sort(keys)
- end
- -- return the iterator function
- local i = 0
- return function()
- i = i + 1
- if keys[i] then
- return keys[i], t[keys[i]]
- end
- end
- end
- -- sparwdzanie czy admin
- function isAdmin(nick)
- for key, val in pairs(admins) do
- if val == nick then
- return true
- end
- end
- return false
- end
- ---- sprawdzanie komend
- function cmd(com, args, nick)
- if commands[args[1]] then
- if not commands[com].arg2 then
- commands[com].arg2 = commands[com].arg
- end
- if commands[com].on == 1 and (((#args - 1) >= commands[com].arg and (#args - 1) <= commands[com].arg2) or commands[com].arg == -1) then
- if commands[com].admin == 1 then
- for key,val in pairs(admins) do
- if val == nick then
- commands[com].func(nick, args)
- return true
- end
- end
- return false
- elseif commands[com].admin == 2 then
- for key,val in pairs(superAdmin) do
- if val == nick then
- commands[com].func(nick, args)
- return true
- end
- end
- return false
- end
- commands[com].func(nick, args)
- return true
- end
- end
- return false
- end
- ---- BBcode
- function bbcode(text)
- text = string.gsub(text, "%[(.?)b%]", "<%1b>")
- text = string.gsub(text, "%[(.?)i%]", "<%1i>")
- text = string.gsub(text, "%[(.?)u%]", "<%1u>")
- text = string.gsub(text, "%[/color%]", "</font>")
- text = string.gsub(text, '%[color=#?(......)%]', '<font color="#%1">')
- return text
- end
- ---- wyswietlanie komunikatów
- function message(nick, msg, color)
- local nick2 = nick
- if nick == 'all' then
- nick2 = nil
- end
- if color == 'red' then
- cr = '#CB546B'
- elseif color == 'green' then
- cr = '#2ECF73'
- elseif color == 'blue' then
- cr = '#2F7FCC'
- end
- ui.addTextArea(2, '<font color="'..cr..'">'..msg..'</font>', nick2, 10, 30, 300, 18, nil, nil,0.9)
- timer[nick] = {}
- timer[nick].tim = 4
- timer[nick].make = function() ui.removeTextArea(2, nick2) end
- end
- ---- terazniejszy czas
- function time()
- local utc = 2
- local h = math.floor(os.time()/1000%86400/60/60) + utc
- local m = math.floor(os.time()/1000%86400/60%60)
- local s = math.floor(os.time()/1000%86400%60%60)
- if h >= 24 then h = h -24 end
- if h < 10 then h = '0'..h end
- if m < 10 then m = '0'..m end
- if s < 10 then s = '0'..s end
- return h..':'..m..':'..s
- end
- ---- licz spacje
- function countSpace(nr, text, d, o)
- local xx = nr - string.len(text)
- if d ~= nil then
- xx = xx/d
- end
- if o ~= nil then
- xx = xx - string.len(o)
- end
- local space = ' '
- for i=2,xx,1 do
- space = space..' '
- end
- return space
- end
- ---- show Help
- function showHelp(nick, kx, ky)
- local space = countSpace(48, ' ['..lg.refresh..']['..lg.close..']')
- 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
- if kx == nil and ky == nil then
- kx, ky = 200, 40
- end
- if module.on == 1 then
- local h = ''
- if modules[module.play].help then
- h = modules[module.play].help
- end
- text = text..'___________________________________________________\n\n<font size="12px"><b>'..lg.minigame..'</b></font> '..modules[module.play].name..'\n\n'..h
- end
- ui.addTextArea(8, text, nick, kx, ky, 400, 300, nil, nil,0.6)
- end
- ---- Pokaz kolejke map
- function showQueue(nick, kx, ky)
- if kx == nil and ky == nil then
- kx, ky = 250, 40
- end
- if settings.queue.on == 0 then
- kolejka = '<font color="#EB1D51">'..lg.disabled..'</font>'
- else
- kolejka = '<VP>'..lg.enabled
- end
- local space = countSpace(38, ' ['..lg.refresh..']['..lg.close..']')
- 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'
- 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'
- local x = 1
- for key,val in pairs(maps) do
- if key > mapNumber then
- local space = countSpace(37,x..'. '..maps[key].name..' - '..maps[key].nick..'['..lg.delete..']')
- 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'
- x = x+1
- end
- end
- ui.addTextArea(1, napis, nick, kx, ky, 300, 300, nil, nil,0.6)
- end
- ---- pokaz opcje
- function options(nick, kx, ky)
- if kx == nil and ky == nil then
- kx, ky = 10, 40
- end
- local adm = ' '
- local add = ' '
- for key,val in pairs(admins) do
- adm = adm..'<font color="#98E2EB">'..val..'</font>, '
- add = add..val..', '
- end
- local space = countSpace(96 , ' ['..lg.refresh..']['..lg.close..']')
- local space2 = countSpace(95 , lg.admins..':'..add..' - '..lg.enabled..' - '..lg.disabled)
- 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>
- <p align="center"><font size="19px">]]..lg.settings..[[</font></p>]]..[[
- <font face="Courier">]]..lg.admins..[[:]]..adm..space2..[[<font color="#40B033">¦ - ]]..lg.enabled..[[</font> <font color="#E33D3D">¦ - ]]..lg.disabled..[[</font></font>
- ]]
- local color
- x = 1
- for key,val in spairs(settings) do
- local onOff
- if val.on == 1 then
- color = '#40B033'
- onOff = '[<a href="event:set off '..key..'"><font color="#E33D3D">'..lg.enable..'</font></a>]'
- else
- color = '#E33D3D'
- onOff = '[<a href="event:set on '..key..'"><font color="#40B033">'..lg.disable..'</font></a>]'
- end
- if not isAdmin(nick) then onOff = ''end
- local line = onOff..' <font color="'..color..'">'..key..'</font> - '..val.des..'\n'
- text = text..line
- x = x+1
- end
- text = text..'\n<font color="#CB546B"><a href="event:stat_reset">['..lg.reset_settings..']</a></font>'
- ui.addTextArea(6, text, nick, kx, ky, 780, 335, 0x424C6B, nil,0.7)
- end
- ---- pokaz liste komend
- function showCmd(nick, kx, ky)
- if kx == nil and ky == nil then
- kx, ky = 10, 40
- end
- local adm = ' '
- local add = ' '
- for key,val in pairs(admins) do
- adm = adm..'<font color="#BABD2F">'..val..'</font>, '
- add = add..val..', '
- end
- local space = countSpace(96 , ' ['..lg.refresh..']['..lg.close..']')
- local space2 = countSpace(96 , lg.admins..': '..add..' - '..lg.enabled..' - '..lg.disabled..' * - '..lg.for_admins)
- 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>
- <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>]]
- local text1 = '<font face="Courier">'
- local text2 = '<font face="Courier">'
- local color
- x = 1
- for key,val in spairs(commands) do
- local arg = ''
- local arg2 = ''
- local star = ' '
- for i=1, val.arg, 1 do
- arg = arg..'<arg'..i..'> '
- end
- if val.arg2 ~= nil then
- for i=1, val.arg2 - val.arg, 1 do
- arg2 = arg2..'[arg'..i..'] '
- end end
- if val.admin == 1 then
- star = '<font color="#ED67EA">*</font>'
- end
- if val.on == 1 then
- color = '#2ECF73'
- else
- color = '#000001'
- end
- local line = star..'<font color="'..color..'">!'..key..' '..arg..arg2..'- '..val.des..'</font>\n'
- if string.len('!'..key..arg..arg2..' - '..val.des) > 47 then
- x = x+1
- end
- if x>22 then
- text2 = text2..line
- else
- text1 = text1..line
- end
- x = x+1
- end
- text1 = text1..'</font>'
- text2 = text2..'</font>'
- ui.addTextArea(3, text, nick, kx, ky, 780, 335, 0x424C6B, nil,0.9)
- ui.addTextArea(4, text1, nick, kx, ky+45, 385, 305, 0x000000, nil,0.6)
- ui.addTextArea(5, text2, nick, kx+395, ky+45, 385, 305, 0x000000, nil,0.6)
- end
- -- pokaz minigry
- function showModules(nick, kx, ky)
- if kx == nil and ky == nil then
- kx, ky = 200, 40
- end
- local space = countSpace(49 , ' ['..lg.close..']')
- local text = [[<font face="Courier"><a href="event:move 7">=</a>]]..space..[[<a href="event:close">[]]..lg.close..[[]</a></font>
- <font size="19px"><p align="center">]]..lg.minigames..[[</p></font>
- <font color="#BABD2F">]]..lg.module_stop..[[</font>
- ]]
- local color
- x = 1
- for key,val in spairs(modules) do
- local author = ''
- if modules[key].author then
- author = ' by '..modules[key].author
- end
- text = text..'<font color="#40B033"><a href="event:module '..key..'">!module '..key..'</a></font> - '..modules[key].name..author..'\n'
- end
- ui.addTextArea(7, text, nick, kx, ky, 400, 335, 0x424C6B, nil, 0.7)
- end
- --
- function modulePlay(nick, name)
- if commands.module.admin > 0 then
- if not isAdmin(nick) then
- return
- end
- end
- module.on = 1
- module.play = name
- message('all', lg.minigame..': '..modules[name].name, 'blue')
- if modules[name].func then
- modules[name]:func(args)
- end
- end
- -------- EVENTS --------
- -- nowy gracz
- function eventNewPlayer(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventNewPlayer then
- modules[module.play]:eventNewPlayer(nick)
- end
- else
- -- modules off
- end
- -- rest
- ui.addTextArea(0, ' ', nick, 10, 30, 1, 1, 0x56F73D, 0x56F73D, 0.5)
- system.bindMouse(nick,true)
- for key,val in pairs({27, 72, 73, 77, 79}) do
- tfm.exec.bindKeyboard(nick,val,true,true)
- end
- for key,val in pairs({72, 73, 77}) do
- tfm.exec.bindKeyboard(nick,val,false,true)
- end
- end
- -- eventPlayerDied
- function eventPlayerDied(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPlayerDied then
- modules[module.play]:eventPlayerDied(nick)
- end
- else
- -- modules off
- end
- if settings.autorespawn.on == 1 or house ~= nil then
- tfm.exec.respawnPlayer(nick)
- end
- end
- -- eventPlayerWon(String playerName)
- function eventPlayerWon(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPlayerWon then
- modules[module.play]:eventPlayerWon(nick)
- end
- else
- -- modules off
- end
- if house ~= nil then
- tfm.exec.respawnPlayer(nick)
- end
- end
- ---- petla
- function eventLoop(t1, t2)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventLoop then
- modules[module.play]:eventLoop(t1, t2)
- end
- else
- -- modules off
- end
- if wait ~= 0 then
- wait = wait -1
- end
- -- queue on, nowa mapa
- if settings.queue.on == 1 and #maps > mapNumber and t2 < t1 and wait == 0 then
- mapNumber = mapNumber +1
- if not tfm.exec.newGame(maps[mapNumber].code) then
- wait = 6
- end
- -- wszyscy martwi
- elseif settings.queue.on == 1 and wait == 0 then
- local dead = 1
- for key,val in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[key].isDead then
- dead = 0
- break
- end
- end
- if dead == 1 then
- if #maps > mapNumber then
- mapNumber = mapNumber +1
- if not tfm.exec.newGame(maps[mapNumber].code) then
- wait = 6
- end
- else
- tfm.exec.newGame(0)
- end
- end
- end
- -- komunikaty
- for key,val in pairs(timer) do
- if timer[key].tim == 0 then
- timer[key].make()
- else
- timer[key].tim = timer[key].tim - 1
- end
- end
- -- auto teleportacja
- for key,val in pairs(playerPosition) do
- local x = playerPosition[key].x
- local y = playerPosition[key].y
- tfm.exec.movePlayer(key, x, y, 0, -1,-1)
- end
- -- piesek
- for key,val in pairs(pet) do
- local x = tfm.get.room.playerList[val].x
- local y = tfm.get.room.playerList[val].y
- tfm.exec.movePlayer(key, x, y, 0, -1,-1)
- end
- end
- -- klawiatura
- function eventKeyboard(nick ,key ,down ,x ,y)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventKeyboard then
- modules[module.play]:eventKeyboard(nick ,key ,down ,x ,y)
- end
- else
- -- modules off
- end
- -- esc
- if key == 27 then
- for i=1, 10, 1 do
- ui.removeTextArea(i, nick)
- end
- -- m - modules
- elseif key == 77 then
- if down then
- showModules(nick)
- else
- ui.removeTextArea(7, nick)
- end
- -- o - opcje
- elseif key == 79 then
- options(nick)
- -- h - help
- elseif key == 72 then
- if down then
- showHelp(nick)
- else
- ui.removeTextArea(8, nick)
- end
- elseif key == 73 then
- if down then
- showCmd(nick)
- else
- ui.removeTextArea(3, nick)
- ui.removeTextArea(4, nick)
- ui.removeTextArea(5, nick)
- end
- end
- end
- ---- klikniecie
- function eventMouse(nick, x, y)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventMouse then
- modules[module.play]:eventMouse(nick, x, y)
- end
- else
- -- modules off
- end
- -- przenoszenie menu
- if move[nick] ~= nil then
- if move[nick] == 6 then
- options(nick, x-8, y-8)
- elseif move[nick] == 1 then
- showQueue(nick, x-8, y-8)
- elseif move[nick] == 3 then
- showCmd(nick, x-8, y-8)
- elseif move[nick] == 8 then
- showHelp(nick, x-8, y-8)
- elseif move[nick] == 7 then
- showModules(nick, x-8, y-8)
- end
- move[nick] = nil
- else
- -- tp
- for key,val in pairs(tp) do
- if key == nick then
- tpp[key] = nil
- playerPosition[key] = nil
- tfm.exec.movePlayer(val, x, y, 0, -1,-1)
- break
- end
- end
- -- tpp
- for key,val in pairs(tpp) do
- if key == nick then
- playerPosition[val] = {}
- playerPosition[val].x = x
- playerPosition[val].y = y
- break
- end
- end
- end
- end
- function name(i, nick)
- if #args < (i+1) then
- return nick
- else
- return args[i+1]
- end
- end
- ---- !komendy
- function eventChatCommand(nick, msg)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventChatCommand then
- modules[module.play]:eventChatCommand(nick, msg)
- end
- else
- -- modules off
- end
- -- log
- Log = '['..time()..'] '..nick..' - !'..msg..'\n'..Log
- -- dzielenie argumentów
- local args={}
- for arg in msg:gmatch("[^%s]+") do
- table.insert(args,arg)
- end
- rest = msg:match("%s(.*)") or ""
- -- wylaczenie dostepu dla tych z banem
- for key,val in pairs(ban) do
- for k,v in pairs(superAdmin) do
- if key == nick and val == true and nick ~= v then
- message(nick, lg.banned, 'red')
- return false
- end
- end
- end
- function name(i)
- if #args < (i+1) then
- return nick
- else
- return args[i+1]
- end
- end
- -------------
- cmd(args[1], args, nick)
- end
- ---- odwolania z <a>
- function eventTextAreaCallback(id, nick, callback)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventTextAreaCallback then
- modules[module.play]:eventTextAreaCallback(id, nick, callback)
- end
- else
- -- modules off
- end
- local args={}
- for arg in callback:gmatch("[^%s]+") do
- table.insert(args,arg)
- end
- -- zamykanie
- if callback == 'close' then
- if id == 3 then
- ui.removeTextArea(3, nick)
- ui.removeTextArea(4, nick)
- ui.removeTextArea(5, nick)
- else
- ui.removeTextArea(id, nick)
- end
- -- odswiezanie
- elseif args[1] == 'refresh' then
- if id == 1 then
- showQueue(nick)
- elseif id == 6 then
- options(nick)
- end
- -- ustawienia
- elseif args[1] == 'set' then
- if args[2] == 'on' then
- settings[args[3]].on = 1
- settings[args[3]].fOn()
- else
- settings[args[3]].on = 0
- settings[args[3]].fOff()
- end
- options(nick)
- -- przenoszenie textarea
- elseif args[1] == 'move' then
- move[nick] = id
- -- resetowanie ustawien
- elseif args[1] == 'stat_reset' then
- for key,val in pairs(settings) do
- settings[key].on = settings[key].def
- end
- options(nick)
- -- !maps usuwanie
- elseif args[1] == 'delmap' then
- if isAdmin(nick) then
- table.remove(maps, args[2])
- showQueue(nick)
- end
- -- moduly
- elseif args[1] == 'module' then
- modulePlay(nick, args[2])
- end
- end
- function eventEmotePlayed(nick, emoteId)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventEmotePlayed then
- modules[module.play]:eventEmotePlayed(nick, emoteId)
- end
- else
- -- modules off
- end
- end
- function eventPlayerGetCheese(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPlayerGetCheese then
- modules[module.play]:eventPlayerGetCheese(nick)
- end
- else
- -- modules off
- end
- end
- function eventPlayerLeft(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPlayerLeft then
- modules[module.play]:eventPlayerLeft(nick)
- end
- else
- -- modules off
- end
- end
- function eventPlayerVampire(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPlayerVampire then
- modules[module.play]:eventPlayerVampire(nick)
- end
- else
- -- modules off
- end
- end
- function eventPlayerWon(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPlayerWon then
- modules[module.play]:eventPlayerWon(nick)
- end
- else
- -- modules off
- end
- end
- function eventPlayerRespawn(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPlayerRespawn then
- modules[module.play]:eventPlayerRespawn(nick)
- end
- else
- -- modules off
- end
- end
- function eventPopupAnswer(id, nick, answer)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventPopupAnswer then
- modules[module.play]:eventPopupAnswer(id, nick, answer)
- end
- else
- -- modules off
- end
- end
- function eventSummoningStart(nick, objectType, x, y, angle)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventSummoningStart then
- modules[module.play]:eventSummoningStart(nick, objectType, x, y, angle)
- end
- else
- -- modules off
- end
- end
- function eventSummoningCancel(nick)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventSummoningCancel then
- modules[module.play]:eventSummoningCancel(nick)
- end
- else
- -- modules off
- end
- end
- function eventSummoningEnd(nick, objectType, x, y, angle, xSpeed, ySpeed, objectType, other)
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventSummoningEnd then
- modules[module.play]:eventSummoningEnd(nick, objectType, x, y, angle, xSpeed, ySpeed, objectType, other)
- end
- else
- -- modules off
- end
- end
- function eventNewGame()
- if module.on == 1 then
- -- modules on
- if modules[module.play].eventNewGame then
- modules[module.play]:eventNewGame()
- end
- else
- -- modules off
- end
- end
- -- wylaczenie widzialnosci komend
- for k,v in pairs(commands) do
- system.disableChatCommandDisplay(k, true)
- end
- -- wymuszenie nowego gracza
- for playername,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(playername)
- end
- print '<R>[SYSTEM]</R>Tribe comand'
- ---- koniec skryptu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement