F\nh", name, hipos[userData[name].hipstate].x, hipos[userData[name].hipstate].y + 185, 20, 38, 0x000022, 0x000030, 0.65, true)
end
annonce2(infpref..trans[235].." ("..name..")")
end
end
-- Koordinātu printeris
local shifting = {}
local eing = {}
local ctrling = {}
local apoing = {}
local oneing = {}
local doting = {}
local dashing = {}
function eventKeyboard(n, key, down, x, y)
if key==34 and hosts[n] then rel(n) trainingcore(n,"keyboard:reload")
elseif key==0 and userData[n].tfm == true then if hosts[n] or helpers[n] then tfm.exec.movePlayer(n,0,0,true,-15,0,true) end
elseif key==1 and userData[n].tfm == true then if hosts[n] or helpers[n] then tfm.exec.movePlayer(n,0,0,true,0,-16,true) end
elseif key==2 and userData[n].tfm == true then if hosts[n] or helpers[n] then tfm.exec.movePlayer(n,0,0,true,15,0,true) end
elseif key==3 and userData[n].tfm == true then if hosts[n] or helpers[n] then tfm.exec.movePlayer(n,0,0,true,0,16,true) end
elseif key==17 or key==9 then ctrling[n] = down
elseif key==33 then nm(n) trainingcore(n,"keyboard:nextmap")
elseif key==16 then shifting[n] = down
elseif key==69 then eing[n] = down
elseif key==187 then oneing[n] = down
elseif key==189 then dashing[n] = down
elseif key==190 then doting[n] = down
elseif key==192 then apoing[n] = down
end end
function eventMouse(n, x, y)
if shifting[n] then
trainingcore(n,"superpowers:getcoordinates;"..x..";"..y)
ui.updateTextArea(33,"• "..n .." "..trans[220].." X:" .. x .. ", Y:" .. y,nil)
ui.updateTextArea(32,"• "..n .." "..trans[220].." X:" .. x .. ", Y:" .. y,nil)
print("• "..n .." "..trans[220].." X:" .. x .. ", Y:" .. y)
end
if apoing[n] and hosts[n] or apoing[n] and helpers[n] then
trainingcore(n,"superpowers:conjuration;"..x..";"..y)
tfm.exec.addConjuration(x/10,y/10,9999999)
end
if eing[n] and hosts[n] or eing[n] and helpers[n] then
trainingcore(n,"superpowers:explosion;"..x..";"..y)
tfm.exec.explosion(x,y,20,50,false)
tfm.exec.displayParticle(12,x,y,0,0,0,0,nil)
end
if ctrling[n] and hosts[n] or ctrling[n] and helpers[n] then
trainingcore(n,"superpowers:teleport;"..x..";"..y)
tfm.exec.movePlayer(n,x,y)
tfm.exec.displayParticle(36,x,y,0,0,0,0,nil)
end
end
table.foreach(tfm.get.room.playerList, eventNewPlayer)
-- HostCore
function hostcore(name)
ui.addTextArea(10, "", name,theme[SETUP.theme].bcX, 25, theme[SETUP.theme].bcWidth, theme[SETUP.theme].hcHeight, theme[SETUP.theme].bcBackground, theme[SETUP.theme].windowBorderColor, theme[SETUP.theme].bcTransparency, true)
ui.addTextArea(65, miscpref..trans[222], name, theme[SETUP.theme].bcX, 25, theme[SETUP.theme].bcWidth, 20, 0x324650, 0x000000, 0, true)
ui.addTextArea(0, ""..title.."
",name,5, -25, 790, 22, 0x000022, 0x000022, 0.65, true)
ui.addTextArea(64, infpref..trans[223].." "..version.." / "..trans[224].." "..tfm.get.room.owner.."", name, theme[SETUP.theme].bcX, 40, theme[SETUP.theme].bcWidth, 20, 0x324650, 0x000000, 0, true)
end
-- eventPlayerDied
function eventPlayerDied(name)
if SETUP.challengemode=="survival" then
local count, winner = 0
for k, v in next, tfm.get.room.playerList do
if not v.isDead then
count = count + 1
winner = k
end
end
if count == 1 then
winnerFunction(winner)
end
print("• "..name.." "..trans[225])
if not disq[name] then
if not spectators[name] then
ui.updateTextArea(0,""..name.." "..trans[226],nil)
end
end
end
if SETUP.autorespawn == true then
tfm.exec.respawnPlayer(name)
end
end
-- [[IZDZĪVOŠANAS CHALLENGE UTILIJAS]]
survtest = [[]]
if SETUP.challengemode == "survival" then
survrounds = 0
--##########################$201###$202####$703#####$701#####$203###$204####$205####$206
survrot = {7482494,7602083,7602098,7605138,7605136,7622015,7637491,7645184,7645263}
function survutils(name)
ui.updateTextArea(0,""..trans[227].."", nil)
survRound()
end
function survRound()
survrounds = survrounds + 1
if survrounds ~= 10 then
srv = survrot[math.random(#survrot)]
tfm.exec.newGame(srv)
elseif survrounds == 10 then
tfm.exec.newGame(survrot[math.random(#survrot)])
end
ui.updateTextArea(0,""..survrounds..trans[40].." "..trans[229],nil)
end
function winnerFunction(winner)
ui.updateTextArea(0,""..winner.." "..trans[231].."
",nil)
ui.updateTextArea(33,"• "..survrounds..trans[40].." "..trans[232].." "..winner.." "..trans[231],nil)
ui.updateTextArea(32,"• "..survrounds..trans[40].." "..trans[232].." "..winner.." "..trans[231],nil)
print('• '..survrounds..trans[40]..' '..trans[233]..' '..winner..' '..trans[231])
tfm.exec.giveCheese(winner)
tfm.exec.playerVictory(winner)
tfm.exec.setPlayerScore(winner,60,true)
tfm.exec.setGameTime(3)
end
end
-- [[BEZ-NAGLU CHALLENGE UTILIJAS]]
if SETUP.challengemode == "vanilla" then
vanillarot = {0,1,2,3,4,5,6,14,15,16,17,18,19,23,24,25,26,27,31,33,37,38,41,43,44,47,49,51,54,55,56,59,64,68,71,79,83,86,99,100,113,119,127,139,147,153,158,161,163,167,200,202,203,207,209} --nelietot 7,8,58,120
function vanillautils()
nextMap()
end
function nextMap()
tfm.exec.newGame(vanillarot[math.random(#vanillarot)])
end
end
-- [[BŪVDARBU CĪŅU UTILIJAS]]
function buildshipready()
tfm.exec.removePhysicObject(-4800)
tfm.exec.removePhysicObject(-4801)
tfm.exec.removePhysicObject(-4802)
end
function buildborder()
tfm.exec.addPhysicObject(-3600,0,0,{type=2,restitution=3,friction=3,width=8,height=15000,groundCollision=true,miceCollision=true})
tfm.exec.addPhysicObject(-3601,inheritwidth,0,{type=2,restitution=3,friction=3,width=8,height=15000,groundCollision=true,miceCollision=true})
end
-- [[MAPJU PAKOTŅU UTILIJAS]]
pkg = {round = -1}
function packageutils(c)
tfm.exec.newGame('#'..pkg.data)
end
first = 0
-- eventPlayerWon
function eventPlayerWon(playerName, timeElapsed, timeElapsedSinceRespawn)
if SETUP.challengemode == "pkg" then
first = first + 1
if first == 1 then
tfm.exec.setPlayerScore(playerName,60,true)
ui.updateTextArea(33,"• "..pkg.round..trans[40].." "..trans[233].." "..playerName.." "..trans[231],nil)
ui.updateTextArea(32,"• "..pkg.round..trans[40].." "..trans[233].." "..playerName.." "..trans[231],nil)
print("• "..pkg.round..trans[40].." "..trans[233].." "..playerName.." "..trans[231])
elseif first > 1 then tfm.exec.setPlayerScore(playerName,10,true)
end
end
end
--##########$302#####$303#####$304###$307###$308#####$309####$310###$311###$312####$313######$314###$315####$316#####$317####$318##$319####$320######$321####$322####$323###$324####$325#####$326#####$327###$328####$329###$330###$331######$332####$333####$334
threerot = {7612717,6265169,6847550,6370623,6333089,6565399,7612788,6975155,7574375,7612773,7612785,6370622,6334320,7612776,7612782,7574389,7574667,7574973,7574975,7574982,7574984,7574997,7574999,7576032,7575113,7576033,7576035,7576224,7576229,7614125,7620702}
function newMap()
tfm.exec.newGame(threerot[math.random(#threerot)]) end
directivecooldown = 3
function eventNewGame()
if SETUP.challengemode=="thirty" then
tfm.exec.setGameTime(30)
ui.addTextArea(24,"", nil, 745, 25, 70, 40, 0x000022, 0x000022, 0, true)
end
local Ptag = string.match(tfm.get.room.xmlMapInfo.xml, "")
local meta = string.match(Ptag, 'meta ?= ?"(.-)"')
local mapName
if meta then
mapName = string.gsub(meta, ",", " - $", 1)..""
print(meta)
ui.setMapName(mapName)
end
if Ptag:find('directive="LoadAsXML"') then tfm.exec.newGame(tfm.get.room.xmlMapInfo.xml) end
if SETUP.challengemode == "pkg" then
pkg.round = pkg.round + 1
ui.updateTextArea(0,""..pkg.round..trans[40].." "..trans[229].."", nil)
end
if SETUP.challengemode=="pkg" then
first=0
end
end
-- functionlist
function functionlist(name)
ui.addTextArea(1080, "\n\n[spectate][toggleborder][togglesailwater][init_hostcore][r_all][clear][getInfo][infclose][about][cn.survival][cn.iziz][cn.build][cn.divine][cn.nonail][cn.thirty][cn.racing][cn.defilante]\n", name, 320, 75, 160, 270, 0x000022, 0x000022, 0.6, true)
ui.addTextArea(1088, "<"..theme[SETUP.theme].windowHeadingColor..">Izpildīt funkciju"..theme[SETUP.theme].windowHeadingColor..">
", name, 320, 75, 160, 30, 0x324650, 0x000000, 0, true)
ui.addTextArea(1086, "\n______________________\nr aizvērt « 1. lapa »", name, 320, 302, 160, 50, 0x324650, 0x000000, 0, true)
end
-- eventLoop
function eventLoop(elaps,rmng)
for name,player in pairs(tfm.get.room.playerList) do
if disq[name] then tfm.exec.killPlayer(name) tfm.exec.setPlayerScore(name,-32768) end
if spectators[name] then tfm.exec.killPlayer(name) tfm.exec.setPlayerScore(name,-100) end
end
if SETUP.challengemode=="thirty" then
ui.updateTextArea(24, ""..math.ceil(rmng/1000), nil)
if rmng <= 0 then table.foreach(tfm.get.room.playerList,tfm.exec.killPlayer) end
if rmng <= -3 and SETUP.autoplay == true then newMap() end
end
if SETUP.challengemode=="survival" then
if rmng <= -3 and SETUP.autoplay == true then survRound() end
end
if SETUP.challengemode=="pkg" then
if rmng <= -3 and SETUP.autoplay == true then packageutils() end
end
if SETUP.challengemode=="vanilla" then
if rmng <= -3 and SETUP.autoplay == true then nextMap() end
end
end
function test()
tfm.exec.newGame(survtest)
end
function eventTextAreaCallback(textAreaID, playerName, callback)
if callback=="spectate" then
trainingcore(playerName,"panel:spectate_legacy")
ui.removeTextArea(100,playerName)
ui.updateTextArea(101,""..trans[239].."
\n"..trans[211].."
",playerName)
end
if callback=="closefunctionlist" then
trainingcore(playerName,"functionlist:close")
for i=1080,1088 do
ui.removeTextArea(i,playerName)
end
end
if callback=="toggleborder" then
trainingcore(playerName,"panel:toggleborder")
buildborder()
end
if callback=="togglesailwater" then
trainingcore(playerName,"panel:togglesailwater")
buildshipready()
end
if callback=="init_hostcore" and hosts[playerName] then
hostcore(playerName)
print(syscore.." "..trans[206].." ("..playerName..")")
ui.updateTextArea(65,syscore.." "..trans[206].." ("..playerName..")",nil)
trainingcore(playerName,"panel:hostcore")
end
if callback=="r_all" then
table.foreach(tfm.get.room.playerList, tfm.exec.respawnPlayer)
trainingcore(playerName,"panel:respawnall")
end
if callback=="hc.actionlog" then
showbuffer(0,playerName)
trainingcore(playerName,"hostcore:toggleactionlog")
end
if callback=="hc.errorlog" then
showbuffer(1,playerName)
trainingcore(playerName,"hostcore:toggleerrorlog")
end
if callback=="hc.commandlog" then
showbuffer(2,playerName)
trainingcore(playerName,"hostcore:togglecommandlog")
end
if callback=="clear" then
clear()
trainingcore(playerName,"panel:clear")
end
if callback=="getInfo" then
ui.removeTextArea(5678,playerName)
ui.addTextArea(600, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"..trans[242].."
\n", playerName, 50, 90, 700, 260, 0x000022, 0x000022, 0.6, true)
ui.addTextArea(601, "SETUP\n---------------
- autoplay: "..tostring(SETUP.autoplay).."
challengemode: "..SETUP.challengemode.."autorespawn: "..tostring(SETUP.autorespawn).."