Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.51 KB | None | 0 0
  1. //script made by Andy, Edit by Pabol for HSHL
  2. //version 1.1.3
  3. //read documentation in README file!
  4.  
  5. geo = {"code": "us", "lat": 37.0902, "lon": -95.7129} //geolokalizacja stanowi o tym, gdzie na liscie bedzie nasz room
  6. var roomConfig = { roomName : "🏒HOCKEY BOT PUB🏒", playerName : "HHL BOT", maxPlayers : 16, public : true, geo}; //ustawienia bota (nazwa rooma/bota/l.graczy/publiczne czy nie/geolokalizacja
  7. var stadiumFileTextBig = '{"name":"2019OfficialHHLStadiumbyATLAS","width":950,"height":450,"spawnDistance":170,"bg":{"type":"hockey","height":400,"width":900,"cornerRadius":200},"vertexes":[/*0*/{"trait":"wall","x":-700,"y":-400,"curve":-90,"color":"CC3300"},/*1*/{"trait":"wall","x":700,"y":-400,"curve":90},/*2*/{"trait":"wall","x":-700,"y":400,"color":"CC3300"},/*3*/{"trait":"wall","x":700,"y":400,"curve":-90},/*4*/{"trait":"wall","x":-900,"y":-200,"curve":-90},/*5*/{"trait":"wall","x":-900,"y":200},/*6*/{"trait":"wall","x":900,"y":-200,"curve":90},/*7*/{"trait":"wall","x":900,"y":200,"curve":-90},/*8*/{"bCoef":0.7,"cMask":["red","blue","ball"],"x":-697,"y":70,"color":"CCCCCC","curve":80},/*9*/{"bCoef":0.7,"cMask":["red","blue","ball"],"x":-697,"y":-70,"color":"cccccc","curve":-80},/*10*/{"trait":"netFrame","x":-760,"y":-40,"curve":140,"color":"000000"},/*11*/{"trait":"netFrame","x":-760,"y":40,"curve":-140,"color":"000000"},/*12*/{"cMask":["none"],"x":-701,"y":-397},/*13*/{"cMask":["none"],"x":-701,"y":397},/*14*/{"trait":"netFrame","x":700,"y":-70,"color":"000000"},/*15*/{"trait":"netFrame","x":760,"y":-40,"color":"000000"},/*16*/{"trait":"netFrame","x":700,"y":70,"color":"000000"},/*17*/{"trait":"netFrame","x":760,"y":40,"color":"000000"},/*18*/{"cMask":["none"],"x":701,"y":-397},/*19*/{"cMask":["none"],"x":701,"y":397},/*20*/{"cMask":["none"],"x":1,"y":-397},/*21*/{"cMask":["none"],"x":1,"y":397},/*22*/{"cMask":["none"],"x":-231,"y":-397,"color":"4466BB"},/*23*/{"cMask":["none"],"x":-231,"y":397,"color":"4466BB"},/*24*/{"cMask":["none"],"x":231,"y":-397,"color":"4466BB"},/*25*/{"cMask":["none"],"x":231,"y":397,"color":"4466BB"},/*26*/{"cMask":["none"],"x":0,"y":-100,"color":"4466BB","curve":-180},/*27*/{"cMask":["none"],"x":0,"y":100,"color":"4466BB","curve":-180},/*28*/{"trait":"circleRed","x":-540,"y":120,"curve":-180},/*29*/{"trait":"circleRed","x":-540,"y":320,"curve":-180},/*30*/{"trait":"circleRed","x":540,"y":-320,"curve":-180},/*31*/{"trait":"circleRed","x":540,"y":-120,"curve":-180},/*32*/{"trait":"circleRed","x":540,"y":120,"curve":-180},/*33*/{"trait":"circleRed","x":540,"y":320,"curve":-180},/*34*/{"trait":"circleRed","x":-540,"y":-320,"curve":-180},/*35*/{"trait":"circleRed","x":-540,"y":-120,"curve":0},/*36*/{"trait":"circleRed","x":540,"y":-224,"curve":-180},/*37*/{"trait":"circleRed","x":540,"y":-216,"curve":-180},/*38*/{"trait":"circleRed","x":540,"y":-222,"curve":-180},/*39*/{"trait":"circleRed","x":540,"y":-218,"curve":-180},/*40*/{"trait":"circleRed","x":540,"y":-222,"curve":-180},/*41*/{"trait":"circleRed","x":540,"y":-218,"curve":-180},/*42*/{"trait":"circleRed","x":540,"y":216,"curve":-180},/*43*/{"trait":"circleRed","x":540,"y":224,"curve":-180},/*44*/{"trait":"circleRed","x":540,"y":218,"curve":-180},/*45*/{"trait":"circleRed","x":540,"y":222,"curve":-180},/*46*/{"trait":"circleRed","x":540,"y":218,"curve":-180},/*47*/{"trait":"circleRed","x":540,"y":222,"curve":-180},/*48*/{"trait":"circleRed","x":-540,"y":-224,"curve":-180},/*49*/{"trait":"circleRed","x":-540,"y":-216,"curve":-180},/*50*/{"trait":"circleRed","x":-540,"y":-222,"curve":-180},/*51*/{"trait":"circleRed","x":-540,"y":-218,"curve":-180},/*52*/{"trait":"circleRed","x":-540,"y":-222,"curve":-180},/*53*/{"trait":"circleRed","x":-540,"y":-218,"curve":-180},/*54*/{"trait":"circleRed","x":-540,"y":216,"curve":-180},/*55*/{"trait":"circleRed","x":-540,"y":224,"curve":-180},/*56*/{"trait":"circleRed","x":-540,"y":218,"curve":-180},/*57*/{"trait":"circleRed","x":-540,"y":222,"curve":-180},/*58*/{"trait":"circleRed","x":-540,"y":218,"curve":-180},/*59*/{"trait":"circleRed","x":-540,"y":222,"curve":-180},/*60*/{"cMask":["redKO"],"x":0,"y":-2,"color":"F0F0F0","curve":-180},/*61*/{"cMask":["redKO"],"x":0,"y":6,"color":"F0F0F0","curve":-180},/*62*/{"cMask":["redKO"],"x":0,"y":0,"color":"F0F0F0","curve":-180},/*63*/{"cMask":["redKO"],"x":0,"y":4,"color":"F0F0F0","curve":-180},/*64*/{"cMask":["redKO"],"x":0,"y":0,"color":"F0F0F0","curve":-180},/*65*/{"cMask":["redKO"],"x":0,"y":4,"color":"F0F0F0","curve":-180},/*66*/{"cMask":["none"],"x":-697,"y":-101,"curve":180},/*67*/{"cMask":["none"],"x":-697,"y":101,"curve":180},/*68*/{"cMask":["none"],"x":-697,"y":-74,"curve":180,"color":"4466BB"},/*69*/{"cMask":["none"],"x":-697,"y":74,"curve":180,"color":"4466BB"},/*70*/{"cMask":["none"],"x":-697,"y":-71,"curve":180,"color":"4466BB"},/*71*/{"cMask":["none"],"x":-697,"y":71,"curve":180,"color":"4466BB"},/*72*/{"cMask":["none"],"x":-697,"y":-68,"curve":180,"color":"4466BB"},/*73*/{"cMask":["none"],"x":-697,"y":68,"curve":180,"color":"4466BB"},/*74*/{"cMask":["none"],"x":-697,"y":-65,"curve":180,"color":"4466BB"},/*75*/{"cMask":["none"],"x":-697,"y":65,"curve":180,"color":"4466BB"},/*76*/{"cMask":["none"],"x":-697,"y":-62,"curve":180,"color":"4466BB"},/*77*/{"cMask":["none"],"x":-697,"y":62,"curve":180,"color":"4466BB"},/*78*/{"cMask":["none"],"x":-697,"y":-59,"curve":180,"color":"4466BB"},/*79*/{"cMask":["none"],"x":-697,"y":59,"curve":180,"color":"4466BB"},/*80*/{"cMask":["none"],"x":-697,"y":-56,"curve":180,"color":"4466BB"},/*81*/{"cMask":["none"],"x":-697,"y":56,"curve":180,"color":"4466BB"},/*82*/{"cMask":["none"],"x":-697,"y":-53,"curve":180,"color":"4466BB"},/*83*/{"cMask":["none"],"x":-697,"y":53,"curve":180,"color":"4466BB"},/*84*/{"cMask":["none"],"x":-697,"y":-50,"curve":180,"color":"4466BB"},/*85*/{"cMask":["none"],"x":-697,"y":50,"curve":180,"color":"4466BB"},/*86*/{"cMask":["none"],"x":-697,"y":-47,"curve":180,"color":"4466BB"},/*87*/{"cMask":["none"],"x":-697,"y":47,"curve":180,"color":"4466BB"},/*88*/{"cMask":["none"],"x":-697,"y":-44,"curve":180,"color":"4466BB"},/*89*/{"cMask":["none"],"x":-697,"y":44,"curve":180,"color":"4466BB"},/*90*/{"cMask":["none"],"x":-697,"y":-41,"curve":180,"color":"4466BB"},/*91*/{"cMask":["none"],"x":-697,"y":41,"curve":180,"color":"4466BB"},/*92*/{"cMask":["none"],"x":-697,"y":-38,"curve":180,"color":"4466BB"},/*93*/{"cMask":["none"],"x":-697,"y":38,"curve":180,"color":"4466BB"},/*94*/{"cMask":["none"],"x":-697,"y":-35,"curve":180,"color":"4466BB"},/*95*/{"cMask":["none"],"x":-697,"y":35,"curve":180,"color":"4466BB"},/*96*/{"cMask":["none"],"x":-697,"y":-32,"curve":180,"color":"4466BB"},/*97*/{"cMask":["none"],"x":-697,"y":32,"curve":180,"color":"4466BB"},/*98*/{"cMask":["none"],"x":-697,"y":-29,"curve":180,"color":"4466BB"},/*99*/{"cMask":["none"],"x":-697,"y":29,"curve":180,"color":"4466BB"},/*100*/{"cMask":["none"],"x":-697,"y":-26,"curve":180,"color":"4466BB"},/*101*/{"cMask":["none"],"x":-697,"y":26,"curve":180,"color":"4466BB"},/*102*/{"cMask":["none"],"x":-697,"y":-23,"curve":180,"color":"4466BB"},/*103*/{"cMask":["none"],"x":-697,"y":23,"curve":180,"color":"4466BB"},/*104*/{"cMask":["none"],"x":-697,"y":-20,"curve":180,"color":"4466BB"},/*105*/{"cMask":["none"],"x":-697,"y":20,"curve":180,"color":"4466BB"},/*106*/{"cMask":["none"],"x":-697,"y":-17,"curve":180,"color":"4466BB"},/*107*/{"cMask":["none"],"x":-697,"y":17,"curve":180,"color":"4466BB"},/*108*/{"cMask":["none"],"x":-697,"y":-14,"curve":180,"color":"4466BB"},/*109*/{"cMask":["none"],"x":-697,"y":14,"curve":180,"color":"4466BB"},/*110*/{"cMask":["none"],"x":-697,"y":-11,"curve":180,"color":"4466BB"},/*111*/{"cMask":["none"],"x":-697,"y":11,"curve":180,"color":"4466BB"},/*112*/{"cMask":["none"],"x":-697,"y":-8,"curve":180,"color":"4466BB"},/*113*/{"cMask":["none"],"x":-697,"y":8,"curve":180,"color":"4466BB"},/*114*/{"cMask":["none"],"x":-697,"y":-5,"curve":180,"color":"4466BB"},/*115*/{"cMask":["none"],"x":-697,"y":5,"curve":180,"color":"4466BB"},/*116*/{"cMask":["none"],"x":-697,"y":-2,"curve":180,"color":"4466BB"},/*117*/{"cMask":["none"],"x":-697,"y":2,"curve":180,"color":"4466BB"},/*118*/{"cMask":["none"],"x":697,"y":74,"curve":180,"color":"4466BB"},/*119*/{"cMask":["none"],"x":697,"y":-74,"curve":180,"color":"4466BB"},/*120*/{"cMask":["none"],"x":697,"y":71,"curve":180,"color":"4466BB"},/*121*/{"cMask":["none"],"x":697,"y":-71,"curve":180,"color":"4466BB"},/*122*/{"cMask":["none"],"x":697,"y":68,"curve":180,"color":"4466BB"},/*123*/{"cMask":["none"],"x":697,"y":-68,"curve":180,"color":"4466BB"},/*124*/{"cMask":["none"],"x":697,"y":65,"curve":180,"color":"4466BB"},/*125*/{"cMask":["none"],"x":697,"y":-65,"curve":180,"color":"4466BB"},/*126*/{"cMask":["none"],"x":697,"y":62,"curve":180,"color":"4466BB"},/*127*/{"cMask":["none"],"x":697,"y":-62,"curve":180,"color":"4466BB"},/*128*/{"cMask":["none"],"x":697,"y":59,"curve":180,"color":"4466BB"},/*129*/{"cMask":["none"],"x":697,"y":-59,"curve":180,"color":"4466BB"},/*130*/{"cMask":["none"],"x":697,"y":56,"curve":180,"color":"4466BB"},/*131*/{"cMask":["none"],"x":697,"y":-56,"curve":180,"color":"4466BB"},/*132*/{"cMask":["none"],"x":697,"y":53,"curve":180,"color":"4466BB"},/*133*/{"cMask":["none"],"x":697,"y":-53,"curve":180,"color":"4466BB"},/*134*/{"cMask":["none"],"x":697,"y":50,"curve":180,"color":"4466BB"},/*135*/{"cMask":["none"],"x":697,"y":-50,"curve":180,"color":"4466BB"},/*136*/{"cMask":["none"],"x":697,"y":47,"curve":180,"color":"4466BB"},/*137*/{"cMask":["none"],"x":697,"y":-47,"curve":180,"color":"4466BB"},/*138*/{"cMask":["none"],"x":697,"y":101,"curve":180,"color":"CC3300"},/*139*/{"cMask":["none"],"x":697,"y":-101,"curve":180,"color":"CC3300"},/*140*/{"cMask":["none"],"x":697,"y":44,"curve":180,"color":"4466BB"},/*141*/{"cMask":["none"],"x":697,"y":-44,"curve":180,"color":"4466BB"},/*142*/{"cMask":["none"],"x":697,"y":41,"curve":180,"color":"4466BB"},/*143*/{"cMask":["none"],"x":697,"y":-41,"curve":180,"color":"4466BB"},/*144*/{"cMask":["none"],"x":697,"y":38,"curve":180,"color":"4466BB"},/*145*/{"cMask":["none"],"x":697,"y":-38,"curve":180,"color":"4466BB"},/*146*/{"cMask":["none"],"x":697,"y":35,"curve":180,"color":"4466BB"},/*147*/{"cMask":["none"],"x":697,"y":-35,"curve":180,"color":"4466BB"},/*148*/{"cMask":["none"],"x":697,"y":32,"curve":180,"color":"4466BB"},/*149*/{"cMask":["none"],"x":697,"y":-32,"curve":180,"color":"4466BB"},/*150*/{"cMask":["none"],"x":697,"y":29,"curve":180,"color":"4466BB"},/*151*/{"cMask":["none"],"x":697,"y":-29,"curve":180,"color":"4466BB"},/*152*/{"cMask":["none"],"x":697,"y":26,"curve":180,"color":"4466BB"},/*153*/{"cMask":["none"],"x":697,"y":-26,"curve":180,"color":"4466BB"},/*154*/{"cMask":["none"],"x":697,"y":23,"curve":180,"color":"4466BB"},/*155*/{"cMask":["none"],"x":697,"y":-23,"curve":180,"color":"4466BB"},/*156*/{"cMask":["none"],"x":697,"y":20,"curve":180,"color":"4466BB"},/*157*/{"cMask":["none"],"x":697,"y":-20,"curve":180,"color":"4466BB"},/*158*/{"cMask":["none"],"x":697,"y":17,"curve":180,"color":"4466BB"},/*159*/{"cMask":["none"],"x":697,"y":-17,"curve":180,"color":"4466BB"},/*160*/{"cMask":["none"],"x":697,"y":14,"curve":180,"color":"4466BB"},/*161*/{"cMask":["none"],"x":697,"y":-14,"curve":180,"color":"4466BB"},/*162*/{"cMask":["none"],"x":697,"y":11,"curve":180,"color":"4466BB"},/*163*/{"cMask":["none"],"x":697,"y":-11,"curve":180,"color":"4466BB"},/*164*/{"cMask":["none"],"x":697,"y":8,"curve":180,"color":"4466BB"},/*165*/{"cMask":["none"],"x":697,"y":-8,"curve":180,"color":"4466BB"},/*166*/{"cMask":["none"],"x":697,"y":5,"curve":180,"color":"4466BB"},/*167*/{"cMask":["none"],"x":697,"y":-5,"curve":180,"color":"4466BB"},/*168*/{"cMask":["none"],"x":697,"y":2,"curve":180,"color":"4466BB"},/*169*/{"cMask":["none"],"x":697,"y":-2,"curve":180,"color":"4466BB"},/*170*/{"trait":"netFrame","x":-700,"y":-68,"curve":140,"color":"000000"},/*171*/{"trait":"netFrame","x":-700,"y":68,"curve":-140,"color":"000000"},/*172*/{"trait":"bouncePuck","x":-749,"y":-403,"curve":-60},/*173*/{"trait":"bouncePuck","x":-903,"y":-265,"curve":-60},/*174*/{"trait":"bouncePuck","x":903,"y":-261,"curve":-60},/*175*/{"trait":"bouncePuck","x":759,"y":-401,"curve":-60},/*176*/{"trait":"bouncePuck","x":737,"y":410,"curve":-65},/*177*/{"trait":"bouncePuck","x":907,"y":255,"curve":-65},/*178*/{"trait":"bouncePuck","x":-904,"y":254,"curve":-65},/*179*/{"trait":"bouncePuck","x":-748,"y":406,"curve":-65},/*180*/{"cMask":["none"],"x":700,"y":-70},/*181*/{"cMask":["none"],"x":700,"y":70},/*182*/{"cMask":["none"],"x":-697,"y":77},/*183*/{"cMask":["none"],"x":-697,"y":80},/*184*/{"cMask":["none"],"x":-697,"y":83},/*185*/{"cMask":["none"],"x":-697,"y":86},/*186*/{"cMask":["none"],"x":-697,"y":89},/*187*/{"cMask":["none"],"x":-697,"y":92},/*188*/{"cMask":["none"],"x":-697,"y":95},/*189*/{"cMask":["none"],"x":-697,"y":98},/*190*/{"cMask":["none"],"x":696.942828717,"y":77,"curve":180,"color":"4466BB"},/*191*/{"cMask":["none"],"x":697.056758252,"y":-77,"curve":180,"color":"4466BB"},/*192*/{"cMask":["none"],"x":696.942828717,"y":80,"curve":180,"color":"4466BB"},/*193*/{"cMask":["none"],"x":697.056758252,"y":-80,"curve":180,"color":"4466BB"},/*194*/{"cMask":["none"],"x":696.942828717,"y":83,"curve":180,"color":"4466BB"},/*195*/{"cMask":["none"],"x":697.056758252,"y":-83,"curve":180,"color":"4466BB"},/*196*/{"cMask":["none"],"x":696.942828717,"y":86,"curve":180,"color":"4466BB"},/*197*/{"cMask":["none"],"x":697.056758252,"y":-86,"curve":180,"color":"4466BB"},/*198*/{"cMask":["none"],"x":696.942828717,"y":89,"curve":180,"color":"4466BB"},/*199*/{"cMask":["none"],"x":697.056758252,"y":-89,"curve":180,"color":"4466BB"},/*200*/{"cMask":["none"],"x":696.942828717,"y":92,"curve":180,"color":"4466BB"},/*201*/{"cMask":["none"],"x":697.056758252,"y":-92,"curve":180,"color":"4466BB"},/*202*/{"cMask":["none"],"x":696.942828717,"y":95,"curve":180,"color":"4466BB"},/*203*/{"cMask":["none"],"x":697.056758252,"y":-95,"curve":180,"color":"4466BB"},/*204*/{"cMask":["none"],"x":696.942828717,"y":98,"curve":180,"color":"4466BB"},/*205*/{"cMask":["none"],"x":697.056758252,"y":-98,"curve":180,"color":"4466BB"},/*206*/{"cMask":["none"],"x":0,"y":-97,"color":"F0F0F0","curve":-180},/*207*/{"cMask":["none"],"x":0,"y":97,"color":"4466BB","curve":-180},/*208*/{"cMask":["none"],"x":0,"y":-97,"color":"F0F0F0","curve":-180},/*209*/{"cMask":["none"],"x":0,"y":97,"color":"4466BB","curve":-180},/*210*/{"cMask":["none"],"x":-697.056758252,"y":-98,"curve":180,"color":"4466BB"},/*211*/{"cMask":["none"],"x":-697,"y":-98},/*212*/{"cMask":["none"],"x":-697,"y":-92},/*213*/{"cMask":["none"],"x":-697,"y":-86},/*214*/{"cMask":["none"],"x":-697,"y":-89},/*215*/{"cMask":["none"],"x":-697,"y":-95},/*216*/{"cMask":["none"],"x":-697,"y":-83},/*217*/{"cMask":["none"],"x":-697,"y":-80},/*218*/{"cMask":["none"],"x":-697,"y":-77},/*219*/{"cMask":["none"],"x":-756,"y":0},/*220*/{"cMask":["none"],"x":756,"y":0},/*221*/{"cMask":["none"],"x":-697,"y":-74},/*222*/{"cMask":["none"],"x":-697,"y":74},/*223*/{"cMask":["none"],"x":-1,"y":-397},/*224*/{"cMask":["none"],"x":-1,"y":397},/*225*/{"x":-21,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*226*/{"x":-21,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*227*/{"x":23,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*228*/{"x":23,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*229*/{"x":-21,"y":-1,"color":"F0F0F0","cMask":["redKO"]},/*230*/{"x":22,"y":0,"color":"F0F0F0","cMask":["redKO"]},/*231*/{"x":41,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*232*/{"x":41,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*233*/{"x":83,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*234*/{"x":-81,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*235*/{"x":-81,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*236*/{"x":-37,"y":-29,"color":"F0F0F0","cMask":["redKO"]},/*237*/{"x":-37,"y":31,"color":"F0F0F0","cMask":["redKO"]},/*238*/{"x":-81,"y":-1,"color":"F0F0F0","cMask":["redKO"]},/*239*/{"x":-38,"y":0,"color":"F0F0F0","cMask":["redKO"]},/*240*/{"x":-18,"y":-26,"color":"000000","cMask":["redKO"]},/*241*/{"x":-18,"y":34,"color":"000000","cMask":["redKO"]},/*242*/{"x":26,"y":-26,"color":"000000","cMask":["redKO"]},/*243*/{"x":26,"y":34,"color":"000000","cMask":["redKO"]},/*244*/{"x":-18,"y":2,"color":"000000","cMask":["redKO"]},/*245*/{"x":25,"y":3,"color":"000000","cMask":["redKO"]},/*246*/{"x":44,"y":-26,"color":"000000","cMask":["redKO"]},/*247*/{"x":44,"y":34,"color":"000000","cMask":["redKO"]},/*248*/{"x":86,"y":34,"color":"000000","cMask":["redKO"]},/*249*/{"x":-78,"y":-26,"color":"000000","cMask":["redKO"]},/*250*/{"x":-78,"y":34,"color":"000000","cMask":["redKO"]},/*251*/{"x":-34,"y":-26,"color":"000000","cMask":["redKO"]},/*252*/{"x":-34,"y":34,"color":"000000","cMask":["redKO"]},/*253*/{"x":-78,"y":2,"color":"000000","cMask":["redKO"]},/*254*/{"x":-35,"y":3,"color":"000000","cMask":["redKO"]}],"segments":[{"trait":"wall","v0":0,"v1":1},{"trait":"wall","v0":2,"v1":3},{"trait":"wall","v0":4,"v1":5},{"trait":"wall","v0":6,"v1":7},{"curve":-90,"trait":"wall","v0":0,"v1":4},{"curve":-90,"trait":"wall","v0":5,"v1":2},{"curve":-90,"trait":"wall","v0":3,"v1":7},{"curve":90,"trait":"wall","v0":1,"v1":6},{"trait":"netFrame","v0":10,"v1":11,"curve":20,"color":"FF0000"},{"curve":0,"trait":"circleRed","v0":12,"v1":13},{"trait":"netFrame","v0":14,"v1":15,"y":-70,"curve":140,"color":"000000"},{"trait":"netFrame","v0":16,"v1":17,"y":70,"curve":-140,"color":"000000"},{"curve":0,"trait":"circleRed","v0":18,"v1":19,"x":700},{"curve":0,"trait":"circleRed","v0":20,"v1":21,"x":0},{"curve":0,"trait":"circleRed","v0":223,"v1":224,"x":0},{"curve":0,"vis":true,"cMask":["none"],"color":"4466BB","v0":22,"v1":23,"x":-230},{"curve":0,"vis":true,"cMask":["none"],"color":"4466BB","v0":24,"v1":25,"x":230},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":26,"v1":27,"x":-230},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":26,"v1":27},{"curve":-180,"trait":"circleRed","v0":28,"v1":29,"x":-540},{"curve":180,"trait":"circleRed","v0":28,"v1":29,"x":-540},{"curve":-180,"trait":"circleRed","v0":30,"v1":31,"x":540},{"curve":180,"trait":"circleRed","v0":30,"v1":31,"x":540},{"curve":-180,"trait":"circleRed","v0":32,"v1":33,"x":540},{"curve":180,"trait":"circleRed","v0":32,"v1":33,"x":540},{"curve":-180,"trait":"circleRed","v0":34,"v1":35,"x":-540},{"curve":180,"trait":"circleRed","v0":34,"v1":35,"x":-540},{"curve":-180,"trait":"circleRed","v0":36,"v1":37,"x":540},{"curve":180,"trait":"circleRed","v0":36,"v1":37,"x":540},{"curve":-180,"trait":"circleRed","v0":38,"v1":39,"x":540},{"curve":180,"trait":"circleRed","v0":38,"v1":39,"x":540},{"curve":-180,"trait":"circleRed","v0":40,"v1":41,"x":540},{"curve":180,"trait":"circleRed","v0":40,"v1":41,"x":540},{"curve":-180,"trait":"circleRed","v0":42,"v1":43,"x":540},{"curve":180,"trait":"circleRed","v0":42,"v1":43,"x":540},{"curve":-180,"trait":"circleRed","v0":44,"v1":45,"x":540},{"curve":180,"trait":"circleRed","v0":44,"v1":45,"x":540},{"curve":-180,"trait":"circleRed","v0":46,"v1":47,"x":540},{"curve":180,"trait":"circleRed","v0":46,"v1":47,"x":540},{"curve":-180,"trait":"circleRed","v0":48,"v1":49,"x":-540},{"curve":180,"trait":"circleRed","v0":48,"v1":49,"x":-540},{"curve":-180,"trait":"circleRed","v0":50,"v1":51,"x":-540},{"curve":180,"trait":"circleRed","v0":50,"v1":51,"x":-540},{"curve":-180,"trait":"circleRed","v0":52,"v1":53,"x":-540},{"curve":180,"trait":"circleRed","v0":52,"v1":53,"x":-540},{"curve":-180,"trait":"circleRed","v0":54,"v1":55,"x":-540},{"curve":180,"trait":"circleRed","v0":54,"v1":55,"x":-540},{"curve":-180,"trait":"circleRed","v0":56,"v1":57,"x":-540},{"curve":180,"trait":"circleRed","v0":56,"v1":57,"x":-540},{"curve":-180,"trait":"circleRed","v0":58,"v1":59,"x":-540},{"curve":180,"trait":"circleRed","v0":58,"v1":59,"x":-540},{"curve":-180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":60,"v1":61,"x":0},{"curve":180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":60,"v1":61,"x":0},{"curve":-180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":62,"v1":63,"x":0},{"curve":180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":62,"v1":63,"x":0},{"curve":-180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":64,"v1":65,"x":0},{"curve":180,"vis":true,"cMask":["redKO"],"color":"F0F0F0","v0":64,"v1":65,"x":0},{"curve":180,"trait":"circleRed","v0":66,"v1":67,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":70,"v1":71,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":72,"v1":73,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":74,"v1":75,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":76,"v1":77,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":78,"v1":79,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":80,"v1":81,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":82,"v1":83,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":84,"v1":85,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":86,"v1":87,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":88,"v1":89,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":90,"v1":91,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":92,"v1":93,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":94,"v1":95,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":96,"v1":97,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":98,"v1":99,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":100,"v1":101,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":102,"v1":103,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":104,"v1":105,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":106,"v1":107,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":108,"v1":109,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":110,"v1":111,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":112,"v1":113,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":114,"v1":115,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":116,"v1":117,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":118,"v1":119,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":120,"v1":121,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":122,"v1":123,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":124,"v1":125,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":126,"v1":127,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":128,"v1":129,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":130,"v1":131,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":132,"v1":133,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":134,"v1":135,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":136,"v1":137,"x":-697},{"curve":180,"trait":"circleRed","v0":138,"v1":139,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":140,"v1":141,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":142,"v1":143,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":144,"v1":145,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":146,"v1":147,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":148,"v1":149,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":150,"v1":151,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":152,"v1":153,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":154,"v1":155,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":156,"v1":157,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":158,"v1":159,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":160,"v1":161,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":162,"v1":163,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":164,"v1":165,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":166,"v1":167,"x":697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":168,"v1":169,"x":697},{"trait":"netFrameRed","v0":170,"v1":171,"x":-700},{"trait":"bouncePuck","v0":172,"v1":173,"curve":-60},{"trait":"bouncePuck","v0":174,"v1":175,"curve":-60},{"trait":"bouncePuck","v0":176,"v1":177,"curve":-65},{"trait":"bouncePuck","v0":178,"v1":179,"curve":-65},{"trait":"netFrameRed","v0":180,"v1":181,"x":-700},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":190,"v1":191,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":192,"v1":193,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":194,"v1":195,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":196,"v1":197,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":198,"v1":199,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":200,"v1":201,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":202,"v1":203,"x":-697},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":204,"v1":205,"x":-697},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":206,"v1":207,"x":-230},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":208,"v1":209},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":182,"v1":218},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":183,"v1":217},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":184,"v1":216},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":185,"v1":213},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":186,"v1":214},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":187,"v1":212},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":188,"v1":215},{"curve":-180,"vis":true,"cMask":["none"],"color":"4466BB","v0":189,"v1":211},{"curve":180,"vis":true,"cMask":["none"],"color":"4466BB","v0":221,"v1":222},{"trait":"netFrame","v0":10,"v1":170,"curve":140,"color":"000000"},{"trait":"netFrame","v0":11,"v1":171,"curve":-140,"color":"000000"},{"trait":"netFrame","v0":17,"v1":15,"curve":20,"color":"0000FF"},{"vis":true,"color":"F0F0F0","v0":225,"v1":226,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":227,"v1":228,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":229,"v1":230,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":231,"v1":232,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":232,"v1":233,"cMask":["redKO"],"y":30},{"vis":true,"color":"F0F0F0","v0":234,"v1":235,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":236,"v1":237,"cMask":["redKO"]},{"vis":true,"color":"F0F0F0","v0":238,"v1":239,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":240,"v1":241,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":242,"v1":243,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":244,"v1":245,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":246,"v1":247,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":247,"v1":248,"cMask":["redKO"],"y":30},{"vis":true,"color":"000000","v0":249,"v1":250,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":251,"v1":252,"cMask":["redKO"]},{"vis":true,"color":"000000","v0":253,"v1":254,"cMask":["redKO"]}],"goals":[{"team":"red","p0":[-708,70],"p1":[-708,-70],"cMask":["ball"],"bCoef":1},{"team":"blue","p0":[708,-70],"p1":[708,70],"cMask":["ball"],"bCoef":1}],"discs":[{"trait":"goalPost","pos":[-700,-70]},{"trait":"goalPost","pos":[-700,70]},{"trait":"goalPost","pos":[700,70]},{"trait":"goalPost","pos":[700,-70]},{"trait":"stopDisc","pos":[-753,0]},{"trait":"stopDisc","pos":[-753,17]},{"trait":"stopDisc","pos":[-755,35]},{"trait":"stopDisc","pos":[-754,-18]},{"trait":"stopDisc","pos":[-755,-35]},{"trait":"stopDisc","pos":[755,-35]},{"trait":"stopDisc","pos":[754,-18]},{"trait":"stopDisc","pos":[753,0]},{"trait":"stopDisc","pos":[753,18]},{"trait":"stopDisc","pos":[755,35]},{"trait":"stopDisc","pos":[-753,-53]},{"trait":"stopDisc","pos":[-740,-68]},{"trait":"stopDisc","pos":[-722,-72]},{"trait":"stopDisc","pos":[-753,54]},{"trait":"stopDisc","pos":[-740,70]},{"trait":"stopDisc","pos":[-722,74]},{"trait":"stopDisc","pos":[754,54]},{"trait":"stopDisc","pos":[741,70]},{"trait":"stopDisc","pos":[721,74]},{"trait":"stopDisc","pos":[722,-74]},{"trait":"stopDisc","pos":[740,-68]},{"trait":"stopDisc","pos":[753,-53]},{"trait":"stopDisc","pos":[-748,62]},{"trait":"stopDisc","pos":[-754,45]},{"trait":"stopDisc","pos":[-753,27]},{"trait":"stopDisc","pos":[-752,8]},{"trait":"stopDisc","pos":[-752,-9]},{"trait":"stopDisc","pos":[-754,-27]},{"trait":"stopDisc","pos":[-754,-45]},{"trait":"stopDisc","pos":[-747,-62]},{"trait":"stopDisc","pos":[-732,-71]},{"trait":"stopDisc","pos":[-713,-70]},{"trait":"stopDisc","pos":[-732,73]},{"trait":"stopDisc","pos":[-712,72]},{"trait":"stopDisc","pos":[711,72]},{"trait":"stopDisc","pos":[731,73]},{"trait":"stopDisc","pos":[749,63]},{"trait":"stopDisc","pos":[756,44]},{"trait":"stopDisc","pos":[753,27]},{"trait":"stopDisc","pos":[753,9]},{"trait":"stopDisc","pos":[753,-9]},{"trait":"stopDisc","pos":[755,-26]},{"trait":"stopDisc","pos":[755,-44]},{"trait":"stopDisc","pos":[749,-61]},{"trait":"stopDisc","pos":[731,-72]},{"trait":"stopDisc","pos":[713,-73]}],"planes":[{"bCoef":1,"cMask":["red","blue"],"dist":-900,"normal":[1,0]},{"bCoef":1,"cMask":["red","blue"],"dist":-900,"normal":[-1,0]},{"bCoef":1,"cMask":["ball"],"dist":-400,"normal":[0,1]},{"bCoef":1,"cMask":["ball"],"dist":-400,"normal":[0,-1]},{"bCoef":1,"cMask":["ball"],"dist":-900,"normal":[1,0]},{"bCoef":1,"cMask":["ball"],"dist":-900,"normal":[-1,0]}],"traits":{"ballArea":{"vis":false,"bCoef":1,"cMask":["ball"]},"wall":{"vis":true,"color":"7e1e1f","bCoef":1,"cMask":["all"],"cGroup":["all"]},"invis":{"vis":false,"cMask":["none"],"color":"666666"},"net":{"vis":true,"cMask":["none"],"color":"dddddd"},"netTop":{"vis":true,"cMask":["none"],"color":"999999"},"netFrame":{"vis":true,"bCoef":0.1,"cMask":["all"],"color":"dddddd"},"netFrameRed":{"vis":false,"cMask":["none"],"color":"7e1e1f"},"circleRed":{"vis":true,"cMask":["none"],"color":"A73D2D"},"goalPost":{"radius":4,"invMass":0,"color":"7e1e1f","bCoef":0.4,"cMask":["all"]},"goalNet":{"vis":true,"bCoef":0.1,"cMask":["ball"]},"bouncePuck":{"vis":false,"bCoef":-6,"cMask":["ball"],"color":"ffee00"},"bouncePuck2":{"vis":true,"bCoef":-6,"cMask":["ball"],"color":"ffee00"},"stopDisc":{"vis":false,"radius":3,"invMass":0,"bCoef":0.1,"cMask":["ball"],"color":"dddddd"},"kickOffBarrier":{"vis":false,"bCoef":0.1,"cGroup":["redKO","blueKO"],"cMask":["red","blue"]}},"ballPhysics":{"radius":7,"bCoef":0.33,"damping":0.994,"color":"000000","invMass":1.3},"playerPhysics":{"bCoef":0.5,"invMass":0.5,"damping":0.98,"acceleration":0.1,"kickStrength":7,"kickingDamping":0.97,"kickingAcceleration":0.15}}' //mapa by natsu
  8.  
  9. var room = HBInit(roomConfig); //inicjacja obiektu room, glownego obiektu naszego pokoju
  10.  
  11. room.setCustomStadium(stadiumFileTextBig); //ustawiamy mape hokeja jako domyslna
  12. room.setScoreLimit(3); //ustawiamy limit bramek na 3
  13. room.setTimeLimit(5); //ustawiamy limit minut na 5
  14. room.setTeamsLock(true); //blokujemy samodzielne przemieszczanie miedzy druzynami
  15.  
  16. function updateAdmins() //funkcja, ktora daje graczowi admina jesli nie ma na roomie zadnego admina
  17. {
  18. var players = room.getPlayerList().filter((player) => player.id != 0 );
  19. if ( players.length == 0 ) return;
  20. if ( players.find((player) => player.admin) != null ) return;
  21. room.setPlayerAdmin(players[0].id, true);
  22. }
  23.  
  24. function initPlayerStats(player) //funkcja inicjująca statystyki gracza
  25. {
  26. if (stats.get(player.name)) return;
  27. stats.set(player.name, [0, 0, 0]) // gole, asysty, czyste konta
  28. }
  29.  
  30. function pushAfkFun(player)
  31. {// !afk
  32. if (!(afkPlayers.includes(player.name)))
  33. {
  34. afkPlayers.push(player.name);
  35. room.setPlayerTeam(player.id, 0);
  36. room.sendChat("Player " + player.name + " is AFK!");
  37. }
  38. }
  39.  
  40. function gotAfkFun(player)
  41. {
  42. if (afkPlayers.includes(player.name))
  43. return true;
  44. }
  45.  
  46. function unAfkFun(player)
  47. { // !jj
  48. if(afkPlayers.includes(player.name))
  49. {
  50. pos = afkPlayers.indexOf(player.name);
  51. afkPlayers.splice(pos, 1);
  52. room.sendChat("Player " + player.name + " is not AFK anymore!");
  53. }
  54. }
  55.  
  56. function pushMuteFun(player, message)
  57. {// !mute Pabol
  58. if (player.admin == true)
  59. if (!(mutedPlayers.includes(message.substr(6)))) mutedPlayers.push(message.substr(6));
  60. }
  61.  
  62. function gotMutedFun(player)
  63. {
  64. if (mutedPlayers.includes(player.name))
  65. return true;
  66. }
  67.  
  68. function unmuteFun(player, message)
  69. { // !unmute Pabol
  70. if (player.admin == true)
  71. {
  72. pos = mutedPlayers.indexOf(message.substr(9));
  73. mutedPlayers.splice(pos, 1);
  74. }
  75. }
  76.  
  77. function statsFun(player, message)
  78. { // !stats Pabol
  79. if (stats.get(message.substr(7)))
  80. sendStats(message.substr(7));
  81. else
  82. return false;
  83. }
  84.  
  85. function gkFun(player)
  86. { // !gk
  87. if (room.getScores() != null)
  88. {
  89. if (player.team == 1)
  90. {
  91. gk[0] = player;
  92. room.sendChat("New GK of Red Team is " + player.name);
  93. }
  94.  
  95. else if (player.team == 2)
  96. {
  97. gk[1] = player;
  98. room.sendChat("New GK of Blue Team is " + player.name);
  99. }
  100. }
  101.  
  102. return;
  103. }
  104.  
  105. function resetStatsFun (player)
  106. { // !resetstats
  107. if (rankingCalc(player.name) > 0)
  108. {
  109. stats.set(player.name, [0,0,0]);
  110. room.sendChat("Your stats have been reseted! ");
  111. }
  112. else
  113. room.sendChat("You must have positive points to be able to reset it, sorry.");
  114. }
  115.  
  116. function rankingCalc(player)
  117. {
  118. // Goal: 5 pts, assist: 3 pts, win: 3 pts, cs: 6 pts
  119. return stats.get(player)[0] * 5 + stats.get(player)[1] * 3 +
  120. stats.get(player)[2] * 6;
  121. }
  122.  
  123. function ranking()
  124. {
  125. var overall = [];
  126. players = Array.from(stats.keys());
  127. for (var i = 2; i < players.length; i++)
  128. {
  129. score = rankingCalc(players[i])
  130. overall.push({name: players[i], goals: stats.get(players[i])[0], assist: stats.get(players[i])[1], cs: stats.get(players[i])[2]});
  131. }
  132.  
  133. overall.sort(function(a,b)
  134. {
  135. return b.value - a.value;
  136. })
  137.  
  138. string = "";
  139.  
  140. var temp = 0;
  141. var pozycji = 0;
  142. for (var i = 0; i < overall.length; i++)
  143. {
  144. if ((overall[i].goals + overall[i].assist + overall[i].cs ) != 0)
  145. {
  146. if(pozycji < 3)
  147. {
  148. string += (i+1-temp) + ") " + overall[i].name + ": " + overall[i].goals + " goals, " + overall[i].assist + " assist, " + overall[i].cs + " cleansheets ";
  149. pozycji++;
  150. }
  151.  
  152. }
  153.  
  154. else
  155. {
  156. temp++;
  157. }
  158.  
  159. }
  160.  
  161. return string;
  162. }
  163.  
  164. function sendStats(name)
  165. {
  166. ps = stats.get(name); // stands for playerstats
  167. room.sendChat(name + ": goals: " + ps[0] + ", assists: " + ps[1]
  168. + ", cs: " + ps[2]);
  169. }
  170.  
  171.  
  172. function whichTeam()
  173. { // gives the players in the red or blue team
  174. var players = room.getPlayerList();
  175. var redTeam = players.filter(player => player.team == 1);
  176. var blueTeam = players.filter(player => player.team == 2);
  177. return [redTeam, blueTeam]
  178. }
  179.  
  180. function isGk()
  181. { // gives the mosts backward players before the first kickOff
  182. var players = room.getPlayerList();
  183. var min = players[0];
  184. min.position = {x: room.getBallPosition().x + 60}
  185. var max = min;
  186.  
  187. for (var i = 0; i < players.length; i++)
  188. {
  189. if (players[i].position != null)
  190. {
  191. if (min.position.x > players[i].position.x) min = players[i];
  192. if (max.position.x < players[i].position.x) max = players[i];
  193. }
  194. }
  195. return [min, max]
  196. }
  197.  
  198. /*
  199. For the game
  200. */
  201.  
  202. // Gives the last player who touched the ball, works only if the ball has the same
  203. // size than in classics maps.
  204. var radiusBall = 7;
  205. var triggerDistance = radiusBall + 15 + 0.1;
  206.  
  207. function getLastTouchTheBall(lastPlayerTouched, time)
  208. {
  209. var ballPosition = room.getBallPosition();
  210. var players = room.getPlayerList();
  211. for(var i = 0; i < players.length; i++)
  212. {
  213. if(players[i].position != null)
  214. {
  215. var distanceToBall = pointDistance(players[i].position, ballPosition);
  216. if(distanceToBall < triggerDistance)
  217. {
  218. lastPlayerTouched = players[i];
  219. return lastPlayerTouched;
  220. }
  221. }
  222. }
  223. return lastPlayerTouched;
  224.  
  225. }
  226.  
  227. // Calculate the distance between 2 points
  228. function pointDistance(p1, p2)
  229. {
  230. var d1 = p1.x - p2.x;
  231. var d2 = p1.y - p2.y;
  232. return Math.sqrt(d1 * d1 + d2 * d2);
  233. }
  234.  
  235. function isOvertime()
  236. {
  237. scores = room.getScores();
  238. if (scores != null)
  239. {
  240. if (scores.timeLimit != 0)
  241. {
  242. if (scores.time > scores.timeLimit)
  243. {
  244. if (scores.red == 0 && hasFinished == false)
  245. {
  246. stats.get(gk[0].name)[2] += 1;
  247. stats.get(gk[1].name)[2] += 1;
  248. hasFinished = true;
  249. }
  250. }
  251. }
  252. }
  253. }
  254. // return: the name of the team who took a goal
  255. var team_name = team => team == 1 ? "blue" : "red";
  256.  
  257. // return: whether it's an OG
  258. var isOwnGoal = (team, player) => team != player.team ? " (og)" : "";
  259.  
  260. // return: a better display of the second when a goal is scored
  261. var floor = s => s < 10 ? "0" + s : s;
  262.  
  263. // return: whether there's an assist
  264. var playerTouchedTwice = playerList => playerList[0].team == playerList[1].team ? " (" + playerList[1].name + ")" : "";
  265.  
  266.  
  267. /*
  268. Events
  269. */
  270. var stats = new Map(); // map where will be set all player stats
  271. var mutedPlayers = []; // Array where will be added muted players
  272. var afkPlayers = [];
  273. var init = "init"; // Smth to initialize smth
  274. init.id = 0; // Faster than getting host's id with the method
  275. init.name = "init";
  276. var scorers ; // Map where will be set all scorers in the current game (undefined if reset or end)
  277. var whoTouchedLast; // var representing the last player who touched the ball
  278. var whoTouchedBall = [init, init]; // Array where will be set the 2 last players who touched the ball
  279. var gk = [init, init];
  280. var goalScored = false;
  281. var checked = false; //TO DO CZESCI Z BETONAMI - warunek wyswietlania info o power play
  282. var betonPlayers = [];
  283. var listOfPlayers;
  284.  
  285. initPlayerStats(room.getPlayerList()[0]) // lazy lol, i'll fix it later
  286. initPlayerStats(init);
  287.  
  288. room.onPlayerLeave = function(player)
  289. {
  290. updateAdmins();
  291. }
  292.  
  293. room.onPlayerJoin = function(player)
  294. {
  295. updateAdmins(); // Gives admin to the first player who join the room if there's no one
  296. initPlayerStats(player); // Set new player's stat
  297. room.sendChat("Hi " + player.name + "! Write !info, !rules, !discord" )
  298. }
  299.  
  300. var redTeam;
  301. var blueTeam;
  302.  
  303. room.onGameStart = function()
  304. {
  305. [redTeam,blueTeam] = whichTeam();
  306. timebetongk = 3.0;
  307. }
  308.  
  309. room.onPlayerTeamChange = function(player)
  310. {
  311. if(player.id == 0)
  312. room.setPlayerTeam(player.id, 0);
  313. }
  314.  
  315. function infoFun()
  316. { // !info
  317. room.sendChat("Pabol is the author of this bot. Player commands: !rules, !info, !discord, !stats [nick], !ranking, !afk, !jj");
  318.  
  319. }
  320.  
  321. function helpadminFun()
  322. { // !helpadmin
  323. if(player.admin == true)
  324. {
  325. room.sendChat("Admin commands: !mute [nick], !unmute [nick], !hockey, !pub [sec] [nick]");
  326. }
  327.  
  328. return false;
  329. }
  330.  
  331. function loginFun(player, message)
  332. { // !hasloadmina
  333.  
  334. room.setPlayerAdmin(player.id, true);
  335. return false; // The message won't be displayed
  336. }
  337.  
  338. function discordFun()
  339. { // !discord
  340. room.sendChat("Our discord: https://discord.gg/tWzURex");
  341. }
  342.  
  343. function hockeyFun(player)
  344. { // !hockey
  345. if(player.admin == true)
  346. {
  347. room.setCustomStadium(stadiumFileTextBig);
  348. room.sendChat("Map has been changed to Hockey 4v4!");
  349. }
  350.  
  351. return false;
  352. }
  353.  
  354. function rulesFun(player)
  355. { // !rules
  356. room.sendChat("Rules: 1) A goalkeeper can only be in his blue area or behind a net. Can´t touch puck or player outside. [Penalty for 2 minutes]", player.id);
  357. room.sendChat("2) A goalkeeper can´t shoot a puck which is behind net, while being inside a net. [Penalty for 30 seconds]", player.id);
  358. room.sendChat("3) A player can´t touch puck in his own gk blue area (beton). [Penalty for 1 minute]", player.id);
  359. room.sendChat("4) A player can´t push an opponent gk during shots. [Penalty for 30 seconds]", player.id);
  360. room.sendChat("5) A team can pull out a goalie to attack when they are loosing, 1 minute before end of the match (powerplay-pp). ", player.id);
  361. room.sendChat("6) A team can make player change in a match only during a period pause or game pause if player have a serious problem. ", player.id);
  362. }
  363.  
  364. function positionFun(player)
  365. { // !position (command for development only, useless during the game)
  366.  
  367. if(player.team == 2)
  368. {
  369. var srodekKola = { x: 698.256, y: -2.0135073 }
  370. var distans = pointDistance(player.position, srodekKola);
  371. room.sendChat("Position x: " + player.position.x + " Position y: " + player.position.y, player.id);
  372. room.sendChat("Distance = " + distans, player.id);
  373. }
  374.  
  375. else if(player.team == 1)
  376. {
  377. var srodekKola = { x: -698.256, y: -2.0135073 }
  378. var distans = pointDistance(player.position, srodekKola);
  379. room.sendChat("Position x: " + player.position.x + " Position y: " + player.position.y, player.id);
  380. room.sendChat("Distance = " + distans, player.id);
  381. }
  382.  
  383. return false;
  384. }
  385.  
  386.  
  387.  
  388. function pubFun(player, message)
  389. { // !pub 60 Pabol
  390.  
  391. if(player.admin == true)
  392. {
  393. var scores2 = room.getScores();
  394. var liczba = parseFloat(message.substr(5).substr(0, message.substr(5).indexOf(" ")));
  395.  
  396. for(var i =0; i<listOfPlayers.length; i++)
  397. {
  398. if(listOfPlayers[i].name == message.substr(5).substr(message.substr(5).indexOf(" ") + 1))
  399. {
  400. var penaltyMinutes = parseInt(liczba/60);
  401. var penaltySeconds = parseInt(liczba%60);
  402.  
  403. if(penaltySeconds < 10)
  404. {
  405. penaltySeconds = "0" + penaltySeconds;
  406. }
  407.  
  408. var returnMinutes = parseInt((scores2.time + liczba)/60);
  409. var returnSeconds = parseInt((scores2.time + liczba)%60);
  410.  
  411. if(returnSeconds < 10)
  412. {
  413. returnSeconds = "0" + returnSeconds;
  414. }
  415.  
  416. betonPlayers.push({player: listOfPlayers[i], value: scores2.time + liczba , team: listOfPlayers[i].team});
  417. room.setPlayerTeam(listOfPlayers[i].id, 0);
  418. room.sendChat("Player " + listOfPlayers[i].name + " has recived " + penaltyMinutes + ":" + penaltySeconds + " minute penalty!" + " He will return on a rink in " + returnMinutes + ":" + returnSeconds + " min!");
  419. }
  420.  
  421. }
  422. }
  423.  
  424.  
  425.  
  426. return false;
  427. }
  428.  
  429.  
  430. function rankFun()
  431. { // !ranking
  432. string = ranking();
  433. room.sendChat("Rank: " + string);
  434. }
  435.  
  436. function clearBansFun(player)
  437. { // !clearbans
  438. if(player.admin == true)
  439. {
  440. room.clearBans();
  441. return false;
  442. }
  443.  
  444. }
  445.  
  446. var commands = {
  447. // Command that doesnt need to know players attributes.
  448. "!info": infoFun,
  449. "!helpadmin": helpadminFun,
  450. "!krulemjestem": loginFun,
  451. "!rules": rulesFun,
  452. "!discord": discordFun,
  453. "!hockey": hockeyFun,
  454. "!position": positionFun,
  455. "!pub": pubFun,
  456. "!ranking": rankFun,
  457. "!clearbans": clearBansFun,
  458. "!afk": pushAfkFun,
  459. "!jj": unAfkFun,
  460.  
  461.  
  462. // Command that need to know who is the player.
  463. "!resetstats": resetStatsFun,
  464. "!gk": gkFun,
  465.  
  466. // Command that need to know what's the message.
  467. "!stats": statsFun,
  468.  
  469. // Command that need to know who is the player and what's the message.
  470. "!mute" : pushMuteFun,
  471. "!unmute": unmuteFun
  472.  
  473. }
  474.  
  475. room.onPlayerChat = function(player, message)
  476. {
  477. if (mutedPlayers.includes(player.name)) return false;
  478. let spacePos = message.search(" ");
  479. let command = message.substr(0, spacePos !== -1 ? spacePos : message.length);
  480. if (commands.hasOwnProperty(command) == true) return commands[command](player, message);
  481. }
  482.  
  483. var bluePlayers;
  484. var redPlayers;
  485.  
  486. //zmienne tablicowe do wylapywania czy jest 3v3 czy ktos pauzuje za beton
  487. var blueBeton;
  488. var redBeton;
  489.  
  490. //zmienne do betonu gk (czas opoznienia po betonie) oraz do betonu gracza z pola
  491. var timebetongk = 0;
  492. var timebetonpole = 0;
  493.  
  494. function betonPlayer()
  495. {
  496. betonPlayers.push({player: whoTouchedLast, value: scores.time + 60, team: whoTouchedLast.team});
  497. room.setPlayerTeam(whoTouchedLast.id, 0);
  498. timebetonpole = scores.time + 1.0;
  499. var returnMinutes = parseInt((scores.time + 60) / 60);
  500. var returnSeconds = parseInt((scores.time + 60) % 60);
  501.  
  502. if(returnSeconds < 10)
  503. returnSeconds = "0" + returnSeconds;
  504.  
  505. room.sendChat("Player " + whoTouchedLast.name + " has touched a puck into his GK box. He has recived the 1 minute penalty. He will return in " + returnMinutes + ":" + returnSeconds + ".");
  506. }
  507.  
  508. function betonGk()
  509. {
  510. room.pauseGame(true);
  511. room.sendChat("Player " + players[0].name + " has touched a puck outside the blue box as a goalkeeper. Capitain has to choose some player who will serve this penalty.");
  512. timebetongk = scores.time + 2.0;
  513. }
  514.  
  515. var players;
  516.  
  517. function IsBeton()
  518. { // funkcja, ktora wykrywa czy byl beton czy nie
  519. bluePlayers = room.getPlayerList().filter((player) => player.team == 2);
  520. redPlayers = room.getPlayerList().filter((player) => player.team == 1);
  521. scores = room.getScores();
  522. blueBeton = betonPlayers.filter((player) => player.team == 2);
  523. redBeton = betonPlayers.filter((player) => player.team == 1);
  524.  
  525. if((bluePlayers.length + blueBeton.length) >= 3 && (redPlayers.length + redBeton.length) >= 3 && scores.time > timebetongk && scores.time > timebetonpole)
  526. {
  527. // BETON BLUE GK
  528. var srodekKola = { x: 697, y: 0}
  529. var liczba = 101;
  530. var ballPosition;
  531. var distans;
  532. var distansBallPlayer;
  533.  
  534. if(gk[1].position != undefined && gk[1].id != 0)
  535. {
  536. players = room.getPlayerList().filter((player) => player.id == gk[1].id && player.id != 0);
  537. distans;
  538. distansBallPlayer
  539. var gkPos;
  540.  
  541. if(players.length != 0)
  542. {
  543. distans = pointDistance(players[0].position, srodekKola);
  544. ballPosition = room.getBallPosition();
  545. distansBallPlayer = pointDistance(players[0].position, ballPosition);
  546. gkPos = players[0].position.x;
  547. }
  548.  
  549. else //Jest to zabezpieczenie, gdy lista graczy jest mniejsza od 0, czyli gdy nie ma gk, nie bedzie betonu dla gk
  550. {
  551. distans = 0;
  552. distansBallPlayer = 50;
  553. gkPos = 0;
  554. }
  555.  
  556.  
  557. if((whoTouchedLast != null) && (gk[1].id == whoTouchedLast.id) && (distans > liczba) && distansBallPlayer < 24.0)
  558. {
  559. if(players[0].position.x < 700.72)
  560. {
  561. if(scores.time < 240)
  562. betonGk();
  563.  
  564. else
  565. {
  566. if (scores.red <= scores.blue)
  567. betonGk();
  568. }
  569. }
  570. }
  571. }
  572. //BETON BLUE Team
  573. bluePlayers = room.getPlayerList().filter((player) => player.team == 2 && player.id != gk[1].id && player.id != 0);
  574. liczba = 118.5;
  575. var playerPos;
  576.  
  577. for(var i = 0; i<bluePlayers.length; i++)
  578. {
  579. playerPos = bluePlayers[i].position.x;
  580.  
  581.  
  582. if(bluePlayers[i].position != undefined)
  583. {
  584. distans = pointDistance(bluePlayers[i].position, srodekKola);
  585. ballPosition = room.getBallPosition();
  586. distansBallPlayer = pointDistance(bluePlayers[i].position, ballPosition);
  587.  
  588. if((whoTouchedLast != null) && (bluePlayers[i].position.x < 700.72) && (bluePlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
  589. {
  590. if(scores.time < 240)
  591. betonPlayer();
  592.  
  593. else
  594. {
  595. if(scores.red <= scores.blue)
  596. betonPlayer();
  597. }
  598. }
  599.  
  600. if((whoTouchedLast != null) && (bluePlayers[i].position.x > 700.72 && bluePlayers[i].position.x < 756.0 && bluePlayers[i].position.y < 101 && bluePlayers[i].position.y > -101) && (bluePlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
  601. {
  602. if(scores.time < 240)
  603. betonPlayer();
  604.  
  605. else
  606. {
  607. if(scores.red <= scores.blue)
  608. betonPlayer();
  609. }
  610. }
  611. }
  612. }
  613. // BETON RED GK
  614. var srodekKola2 = { x: -697, y: 0}
  615. liczba = 101;
  616. if(gk[0].position != undefined && gk[0].id != 0)
  617. {
  618. players = room.getPlayerList().filter((player) => player.id == gk[0].id && player.id != 0);
  619. distans;
  620. distansBallPlayer;
  621. var gkPos;
  622.  
  623. if(players.length != 0)
  624. {
  625. distans = pointDistance(players[0].position, srodekKola2);
  626. ballPosition = room.getBallPosition();
  627. distansBallPlayer = pointDistance(players[0].position, ballPosition);
  628. gkPos = players[0].position.x;
  629. }
  630.  
  631. else
  632. {
  633. distans = 0;
  634. distansBallPlayer = 50;
  635. gkPos = 0;
  636. }
  637.  
  638.  
  639.  
  640. if((whoTouchedLast != null) && (gk[0].id == whoTouchedLast.id) && (distans > liczba) && distansBallPlayer < 24.0)
  641. {
  642. if(players[0].position.x > -700.72)
  643. {
  644. if(scores.time < 240)
  645. betonGk();
  646.  
  647. else
  648. {
  649. if(scores.red >= scores.blue)
  650. betonGk();
  651. }
  652. }
  653. }
  654. }
  655. //BETON Red team
  656. redPlayers = room.getPlayerList().filter((player) => player.team == 1 && player.id != gk[0].id && player.id != 0);
  657. liczba = 118.5;
  658. for(var i = 0; i<redPlayers.length; i++)
  659. {
  660. if(redPlayers[i].position != undefined)
  661. {
  662. distans = pointDistance(redPlayers[i].position, srodekKola2);
  663. ballPosition = room.getBallPosition();
  664. distansBallPlayer = pointDistance(redPlayers[i].position, ballPosition);
  665. playerPos = redPlayers[i].position.x;
  666.  
  667.  
  668.  
  669. if((whoTouchedLast != null) && (redPlayers[i].position.x > -700.72) && (redPlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
  670. {
  671. if(scores.time < 240)
  672. betonPlayer();
  673.  
  674. else
  675. {
  676. if(scores.red >= scores.blue)
  677. betonPlayer();
  678. }
  679. }
  680.  
  681. if((whoTouchedLast != null) && (redPlayers[i].position.x < -700.72 && redPlayers[i].position.x > -756.0 && redPlayers[i].position.y < 101 && redPlayers[i].position.y > -101) && (redPlayers[i].id == whoTouchedLast.id) && (distans < liczba) && distansBallPlayer < 24.0)
  682. {
  683. if(scores.time < 240)
  684. betonPlayer();
  685.  
  686. else
  687. {
  688. if(scores.red >= scores.blue)
  689. betonPlayer();
  690. }
  691. }
  692. }
  693. }
  694. }
  695. }
  696.  
  697. room.onPlayerBallKick = function (player)
  698. {
  699. whoTouchedLast = player;
  700. IsBeton();
  701. }
  702.  
  703. var kickOff = false;
  704. var hasFinished = false;
  705.  
  706. room.onGameTick = function()
  707. {
  708. setInterval(isOvertime, 5000, hasFinished);
  709. listOfPlayers = room.getPlayerList().filter((player) => player.id != 0);
  710.  
  711. if (kickOff == false)
  712. { // simplest comparison to not charge usulessly the tick thing
  713. if (room.getScores().time != 0)
  714. {
  715. kickOff = true;
  716. gk = isGk();
  717. room.sendChat("Red GK: " + gk[0].name + ", Blue GK: " + gk[1].name)
  718. }
  719. }
  720.  
  721. if (goalScored == false)
  722. whoTouchedLast = getLastTouchTheBall(whoTouchedLast);
  723.  
  724. if (whoTouchedLast != undefined)
  725. {
  726. if (whoTouchedLast.id != whoTouchedBall[0].id)
  727. {
  728. whoTouchedBall[1] = whoTouchedBall[0];
  729. whoTouchedBall[0] = whoTouchedLast; // last player who touched the ball
  730. }
  731.  
  732. scores = room.getScores();
  733. //checked - previously initialized boolean variable - send powerplay info
  734. if(checked == false && scores.time > 240 && scores.time < 300 && scores.blue != scores.red)
  735. {
  736. checked = true;
  737. if(scores.blue > scores.red)
  738. room.sendChat("POWERPLAY FOR RED TEAM! RED TEAM'S GK CAN GO OUTSIDE A BLUE BOX");
  739.  
  740. else
  741. room.sendChat("POWER PLAY FOR BLUE TEAM! BLUE TEAM'S GK CAN GO OUTSIDE A BLUE BOX");
  742. }
  743.  
  744. IsBeton();
  745. }
  746.  
  747. //po uplywie czasu kary gracz wraca do druzyny
  748. for(var i = 0; i<betonPlayers.length; i++)
  749. {
  750. if(betonPlayers[i].value <= scores.time)
  751. {
  752. betonPlayers[i].player.team = betonPlayers[i].team;
  753. room.setPlayerTeam(betonPlayers[i].player.id, betonPlayers[i].team);
  754. betonPlayers.shift();
  755. }
  756. }
  757. }
  758.  
  759. room.onTeamGoal = function(team)
  760. { // Write on chat who scored and when.
  761. var temp_name = "";
  762. goalScored = true;
  763. var time = room.getScores().time;
  764. timebetongk = time + 3.0;
  765. var m = Math.trunc(time/60); var s = Math.trunc(time % 60);
  766. time = m + ":" + floor(s); // MM:SS format
  767. var ownGoal = isOwnGoal(team, whoTouchedBall[0]);
  768. var assist = "";
  769. if (ownGoal == "") assist = playerTouchedTwice(whoTouchedBall);
  770.  
  771. if(ownGoal == "")
  772. {
  773. room.sendChat("A goal has been scored by " + whoTouchedBall[0].name +
  774. assist + " at " +
  775. time + " against team " + team_name(team));
  776. }
  777.  
  778. else
  779. {
  780. for(var pom = 0; pom < whoTouchedBall.length; pom++)
  781. {
  782. if(whoTouchedBall[pom].team == team)
  783. {
  784. temp_name = whoTouchedBall[pom].name;
  785. room.sendChat("A goal has been scored by " + whoTouchedBall[pom].name + " " +
  786. time + " against team " + team_name(team));
  787. break;
  788. }
  789. }
  790. }
  791.  
  792. if (ownGoal != "")
  793. {
  794. if(temp_name != "")
  795. stats.get(temp_name)[0] += 1;
  796. }
  797.  
  798. else
  799. {
  800. stats.get(whoTouchedBall[0].name)[0] += 1;
  801. }
  802.  
  803. if (whoTouchedBall[1] != init && assist != "") stats.get(whoTouchedBall[1].name)[1] += 1;
  804.  
  805. if (scorers == undefined) scorers = new Map(); // Initializing dict of scorers
  806. if(ownGoal != "")
  807. {
  808. scorers.set(scorers.size + 1 +") " + temp_name, [time, assist, ownGoal]);
  809. temp_name = "";
  810. }
  811.  
  812. else
  813. scorers.set(scorers.size + 1 +") " + whoTouchedLast.name, [time, assist, ownGoal])
  814.  
  815. whoTouchedBall = [init, init];
  816. whoTouchedLast = undefined;
  817.  
  818. //jak druzyna strzela gola to gracz ktory odbywal kare w przeciwnej druzynie wchodzi na boisko
  819. for(var i = 0; i<betonPlayers.length; i++)
  820. {
  821. if(betonPlayers[i].team != team)
  822. {
  823. betonPlayers[i].player.team = betonPlayers[i].team;
  824. betonPlayers[i].value = 0;
  825. room.sendChat(betonPlayers[i].player.name + "'s penalty has been shortened due to lost goal by his team.");
  826. }
  827. }
  828. }
  829.  
  830. room.onPositionsReset = function()
  831. {
  832. goalScored = false;
  833. }
  834.  
  835. room.onTeamVictory = function(scores)
  836. { // Sum up all scorers since the beginning of the match.
  837. if (scores.blue == 0 && gk[0].position != null && hasFinished == false) stats.get(gk[0].name)[2] += 1;
  838. if (scores.red == 0 && gk[1].position != null && hasFinished == false) stats.get(gk[1].name)[2] += 1;
  839.  
  840. room.sendChat("Scored goals:")
  841. for (var [key, value] of scorers)
  842. { // key: name of the player, value: time of the goal
  843. if(value[2] == " (og)")
  844. {
  845. room.sendChat(key + " : " + value[0]);
  846. }
  847. else
  848. {
  849. room.sendChat(key + " " + value[1] + value[2] + ": " + value[0]);
  850. }
  851. }
  852.  
  853. for(var i = 0; i<betonPlayers.length; i++)
  854. {
  855. betonPlayers[i].player.team = betonPlayers[i].team;
  856. room.setPlayerTeam(betonPlayers[i].player.id, betonPlayers[i].team);
  857. betonPlayers.shift();
  858. }
  859.  
  860. timebetongk = 0;
  861. timebetonpole = 0;
  862. goalScored = false;
  863. }
  864.  
  865. room.onPlayerTeamChange = function(changedPlayer)
  866. {
  867. if(changedPlayer.id == gk[0].id)
  868. {
  869. gk[0].id = 0;
  870. room.sendChat("GK red left team. New gk must type !gk");
  871. }
  872.  
  873. if(changedPlayer.id == gk[1].id)
  874. {
  875. gk[1].id = 0;
  876. room.sendChat("GK blue left team. New gk must type !gk");
  877. }
  878.  
  879.  
  880. if(gotAfkFun(changedPlayer) && changedPlayer.team != 0)
  881. {
  882. room.setPlayerTeam(changedPlayer.id, 0);
  883. room.sendChat("Pick another player! (AFK)");
  884. }
  885. }
  886.  
  887. room.onGameStop = function()
  888. {
  889. scorers = undefined;
  890. whoTouchedBall = [init, init];
  891. whoTouchedLast = undefined;
  892. gk = [init, init];
  893. kickOff = false;
  894. hasFinished = false;
  895. checked = false;
  896. goalScored = false;
  897.  
  898. for(var i = 0; i<betonPlayers.length; i++)
  899. {
  900. betonPlayers[i].player.team = betonPlayers[i].team;
  901. room.setPlayerTeam(betonPlayers[i].player.id, betonPlayers[i].team);
  902. betonPlayers.shift();
  903. }
  904.  
  905. timebetongk = 0;
  906. timebetonpole = 0;
  907. }
  908.  
  909. room.onStadiumChange = function(newStadiumName, byPlayer)
  910. {
  911. if(byPlayer.id != 0)
  912. {
  913. room.setCustomStadium(stadiumFileTextBig);
  914. room.sendChat("Map change function is blocked! Map changed to Hockey 4v4!");
  915. }
  916. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement