Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.44 KB | None | 0 0
  1. /* SETTINGS */
  2.  
  3. var salaoficial = false;
  4. /* ROOM */
  5.  
  6. var roomName = "Alaba's room | Real Soccer 4X4";
  7. var maxPlayers = 12;
  8. var roomPublic = true;
  9. var playerName = "Bot";
  10. var real = '{"name" : "WeAreHaxball | RF V2.0","width" : 1300,"height" : 670,"spawnDistance" : 500,"bg" : { "type" : "grass", "width" : 1150, "height" : 600, "kickOffRadius" : 180, "cornerRadius" : 0 },"playerPhysics" : {"bCoef" : 0.5,"invMass" : 0.5,"damping" : 0.96,"acceleration" : 0.12,"kickingAcceleration" : 0.07,"kickingDamping" : 0.96,"kickStrength" : 5.65 },"vertexes" : [{"x" : 0,"y" : 700,"trait" : "kickOffBarrier" },{"x" : 0,"y" : 180,"trait" : "kickOffBarrier" },{"x" : 0,"y" : -180,"trait" : "kickOffBarrier" },{"x" : 0,"y" : -700,"trait" : "kickOffBarrier" },{"x" : 1150,"y" : 255,"trait" : "line" },{"x" : 840,"y" : 255,"trait" : "line" },{"x" : 1150,"y" : -255,"trait" : "line" },{"x" : 840,"y" : -255,"trait" : "line" },{"x" : 1150,"y" : 155,"trait" : "line" },{"x" : 1030,"y" : 155,"trait" : "line" },{"x" : 1150,"y" : -155,"trait" : "line" },{"x" : 1030,"y" : -155,"trait" : "line" },{"x" : 840,"y" : -135,"trait" : "line","curve" : -130 },{"x" : 840,"y" : 135,"trait" : "line","curve" : -130 },{"x" : -1150,"y" : -255,"trait" : "line","curve" : -90,"color" : "97AC86" },{"x" : -840,"y" : -255,"trait" : "line" },{"x" : -1150,"y" : 255,"trait" : "line" },{"x" : -840,"y" : 255,"trait" : "line" },{"x" : -1150,"y" : -155,"trait" : "line" },{"x" : -1030,"y" : -155,"trait" : "line" },{"x" : -1150,"y" : 155,"trait" : "line" },{"x" : -1030,"y" : 155,"trait" : "line" },{"x" : -840,"y" : 135,"trait" : "line","curve" : -130 },{"x" : -840,"y" : -135,"trait" : "line","curve" : -130 },{"x" : 935,"y" : 4,"trait" : "line" },{"x" : 935,"y" : -4,"trait" : "line" },{"x" : -935,"y" : 4,"trait" : "line" },{"x" : -935,"y" : -4,"trait" : "line" },{"x" : -1150,"y" : 575,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : -1125,"y" : 600,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : -1125,"y" : -600,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : -1150,"y" : -575,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : 1125,"y" : 600,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : 1150,"y" : 575,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : 1150,"y" : -575,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : 1125,"y" : -600,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"x" : -1150,"y" : 127,"trait" : "line","color" : "ffffff" },{"x" : -1210,"y" : 124,"trait" : "line","color" : "ffffff","curve" : 5 },{"x" : -1150,"y" : -127,"trait" : "line","color" : "ffffff" },{"x" : -1210,"y" : -124,"trait" : "line","color" : "ffffff","curve" : 5 },{"x" : 1150,"y" : 127,"trait" : "line","color" : "ffffff" },{"x" : 1210,"y" : 124,"trait" : "line","color" : "ffffff","curve" : -5 },{"x" : 1150,"y" : -127,"trait" : "line","color" : "ffffff" },{"x" : 1210,"y" : -124,"trait" : "line","color" : "ffffff","curve" : -5 },{"x" : 0,"y" : -4,"trait" : "line" },{"x" : 0,"y" : 4,"trait" : "line" },{"x" : 0,"y" : -4,"trait" : "line" },{"x" : 0,"y" : 4,"trait" : "line" },{"x" : -1210,"y" : 124,"trait" : "line","color" : "ffffff" },{"x" : -1250,"y" : 150,"trait" : "line","color" : "ffffff","pos" : [-1250,150] },{"x" : -1210,"y" : -124,"trait" : "line","color" : "ffffff","_selected" : true },{"x" : -1250,"y" : -150,"trait" : "line","color" : "ffffff","pos" : [-1250,-150] },{"x" : 1210,"y" : 124,"trait" : "line","color" : "ffffff" },{"x" : 1250,"y" : 150,"trait" : "line","color" : "ffffff" },{"x" : 1210,"y" : -124,"trait" : "line","color" : "ffffff" },{"x" : 1250,"y" : -150,"trait" : "line","color" : "ffffff" },{"x" : -1185,"y" : 155,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : 40,"color" : "BEB86C" },{"x" : -1185,"y" : 255,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : 40,"color" : "BEB86C" },{"x" : 1185,"y" : 155,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : -40,"color" : "BEB86C" },{"x" : 1185,"y" : 255,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : -40,"color" : "BEB86C" },{"x" : -1185,"y" : -155,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : -40,"color" : "BEB86C" },{"x" : -1185,"y" : -255,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : -40,"color" : "BEB86C" },{"x" : 1185,"y" : -155,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : 40,"color" : "BEB86C" },{"x" : 1185,"y" : -255,"bCoef" : -4.5,"cMask" : ["ball"],"trait" : "line","curve" : 40,"color" : "BEB86C" },{"x" : 1158,"y" : -607,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : 0,"color" : "BEB86C" },{"x" : 1187,"y" : -578,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : -60,"color" : "BEB86C" },{"x" : 1158,"y" : 607,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : 0,"color" : "BEB86C" },{"x" : 1187,"y" : 578,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : 60,"color" : "BEB86C" },{"x" : -1158,"y" : 607,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : 0,"color" : "BEB86C" },{"x" : -1187,"y" : 578,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : -60,"color" : "BEB86C" },{"x" : -1158,"y" : -607,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : 0,"color" : "BEB86C" },{"x" : -1187,"y" : -578,"bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line","curve" : 60,"color" : "BEB86C" },{"x" : -1190,"y" : -255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1180,"y" : -255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1190,"y" : -155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1180,"y" : -155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1190,"y" : 155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1180,"y" : 155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1190,"y" : 255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1180,"y" : 255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1190,"y" : -255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1180,"y" : -255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1190,"y" : -155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1180,"y" : -155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1190,"y" : 255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1180,"y" : 255,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1190,"y" : 155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : 1180,"y" : 155,"bCoef" : -1,"cMask" : ["ball"],"trait" : "line","color" : "000000","curve" : 0 },{"x" : -1148,"y" : -525,"trait" : "line","curve" : -90,"color" : "5E844D" },{"x" : 1148,"y" : -525,"trait" : "line","color" : "5E844D" },{"x" : -1148,"y" : 525,"trait" : "line","curve" : -90,"color" : "5E844D" },{"x" : 1148,"y" : 525,"trait" : "line","color" : "5E844D" },{"x" : -1150,"y" : -260,"trait" : "line","curve" : -100,"color" : "5E844D" },{"x" : -840,"y" : -600,"trait" : "line","color" : "5E844D","curve" : -100 },{"x" : -1150,"y" : 260,"trait" : "line","curve" : 100,"color" : "5E844D" },{"x" : -840,"y" : 600,"trait" : "line","color" : "5E844D","curve" : 100 },{"x" : -840,"y" : -1150,"trait" : "line","color" : "5E844D","curve" : -100 },{"x" : 1150,"y" : -260,"trait" : "line","curve" : 100,"color" : "5E844D" },{"x" : 840,"y" : -600,"trait" : "line","color" : "5E844D","curve" : 100 },{"x" : 1150,"y" : 260,"trait" : "line","curve" : -100,"color" : "5E844D" },{"x" : 840,"y" : 600,"trait" : "line","color" : "5E844D","curve" : -100 }],"segments" : [{"v0" : 37,"v1" : 39,"curve" : 5,"color" : "ffffff","trait" : "reargoalNetleft","x" : -1210 },{"v0" : 41,"v1" : 43,"curve" : -5,"color" : "ffffff","trait" : "reargoalNetright" },{"v0" : 4,"v1" : 5,"trait" : "line","y" : 250 },{"v0" : 5,"v1" : 7,"trait" : "line","x" : 840 },{"v0" : 6,"v1" : 7,"trait" : "line","y" : -250 },{"v0" : 8,"v1" : 9,"trait" : "line","y" : 150 },{"v0" : 9,"v1" : 11,"trait" : "line","x" : 1030 },{"v0" : 10,"v1" : 11,"trait" : "line","y" : -150 },{"v0" : 12,"v1" : 13,"curve" : -130,"trait" : "line","x" : 840 },{"v0" : 14,"v1" : 15,"trait" : "line","y" : -250 },{"v0" : 15,"v1" : 17,"trait" : "line","x" : -840 },{"v0" : 16,"v1" : 17,"trait" : "line","y" : 250 },{"v0" : 18,"v1" : 19,"trait" : "line","y" : -150 },{"v0" : 19,"v1" : 21,"trait" : "line","x" : -1030 },{"v0" : 20,"v1" : 21,"trait" : "line","y" : 150 },{"v0" : 22,"v1" : 23,"curve" : -130,"trait" : "line","x" : -840 },{"v0" : 24,"v1" : 25,"curve" : -180,"trait" : "line","x" : 935 },{"v0" : 26,"v1" : 27,"curve" : -180,"trait" : "line","x" : -935 },{"v0" : 24,"v1" : 25,"curve" : 180,"trait" : "line","x" : 935 },{"v0" : 26,"v1" : 27,"curve" : 180,"trait" : "line","x" : -935 },{"v0" : 24,"v1" : 25,"curve" : 90,"trait" : "line","x" : 935 },{"v0" : 26,"v1" : 27,"curve" : 90,"trait" : "line","x" : -935 },{"v0" : 24,"v1" : 25,"curve" : -90,"trait" : "line","x" : 935 },{"v0" : 26,"v1" : 27,"curve" : -90,"trait" : "line","x" : -935 },{"v0" : 24,"v1" : 25,"trait" : "line","x" : 935 },{"v0" : 26,"v1" : 27,"trait" : "line","x" : -935 },{"v0" : 28,"v1" : 29,"curve" : 90,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"v0" : 30,"v1" : 31,"curve" : 90,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"v0" : 32,"v1" : 33,"curve" : 90,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"v0" : 34,"v1" : 35,"curve" : 90,"bCoef" : 0,"cMask" : ["wall"],"trait" : "line" },{"v0" : 36,"v1" : 37,"curve" : 5,"color" : "ffffff","trait" : "sidegoalNet" },{"v0" : 38,"v1" : 39,"curve" : -5,"color" : "ffffff","trait" : "sidegoalNet" },{"v0" : 40,"v1" : 41,"curve" : -5,"color" : "ffffff","trait" : "sidegoalNet" },{"v0" : 42,"v1" : 43,"curve" : 5,"color" : "ffffff","trait" : "sidegoalNet" },{"v0" : 44,"v1" : 45,"curve" : -180,"trait" : "line" },{"v0" : 46,"v1" : 47,"curve" : 180,"trait" : "line" },{"v0" : 44,"v1" : 45,"curve" : -90,"trait" : "line" },{"v0" : 46,"v1" : 47,"curve" : 90,"trait" : "line" },{"v0" : 48,"v1" : 49,"color" : "ffffff","trait" : "line" },{"v0" : 50,"v1" : 51,"color" : "ffffff","trait" : "line" },{"v0" : 52,"v1" : 53,"color" : "ffffff","trait" : "line" },{"v0" : 54,"v1" : 55,"color" : "ffffff","trait" : "line" },{"v0" : 56,"v1" : 57,"curve" : 40,"vis" : true,"color" : "BEB86C","bCoef" : -4.7,"cMask" : ["ball"],"trait" : "line","x" : -1220 },{"v0" : 58,"v1" : 59,"curve" : -40,"vis" : true,"color" : "BEB86C","bCoef" : -4.7,"cMask" : ["ball"],"trait" : "line","x" : 1220 },{"v0" : 60,"v1" : 61,"curve" : -40,"vis" : true,"color" : "BEB86C","bCoef" : -4.7,"cMask" : ["ball"],"trait" : "line","x" : -1220 },{"v0" : 62,"v1" : 63,"curve" : 40,"vis" : true,"color" : "BEB86C","bCoef" : -4.7,"cMask" : ["ball"],"trait" : "line","x" : 1220 },{"v0" : 64,"v1" : 65,"curve" : -60,"vis" : true,"color" : "BEB86C","bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line" },{"v0" : 66,"v1" : 67,"curve" : 60,"vis" : true,"color" : "BEB86C","bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line" },{"v0" : 68,"v1" : 69,"curve" : -60,"vis" : true,"color" : "BEB86C","bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line" },{"v0" : 70,"v1" : 71,"curve" : 60,"vis" : true,"color" : "BEB86C","bCoef" : -2.45,"cMask" : ["ball"],"trait" : "line" },{"v0" : 0,"v1" : 1,"trait" : "kickOffBarrier" },{"v0" : 1,"v1" : 2,"curve" : 180,"cGroup" : ["blueKO"],"trait" : "kickOffBarrier" },{"v0" : 1,"v1" : 2,"curve" : -180,"cGroup" : ["redKO"],"trait" : "kickOffBarrier" },{"v0" : 2,"v1" : 3,"trait" : "kickOffBarrier" },{"v0" : 72,"v1" : 73,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 74,"v1" : 75,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 76,"v1" : 77,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 78,"v1" : 79,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 80,"v1" : 81,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 82,"v1" : 83,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 84,"v1" : 85,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 86,"v1" : 87,"curve" : 0,"vis" : true,"color" : "000000","bCoef" : -1,"cMask" : ["ball"],"trait" : "line" },{"v0" : 88,"v1" : 89,"color" : "5E844D","trait" : "line","y" : -475 },{"v0" : 90,"v1" : 91,"color" : "5E844D","trait" : "line","y" : -475 },{"v0" : 92,"v1" : 93,"curve" : -100,"color" : "5E844D","trait" : "line","y" : -475 },{"v0" : 94,"v1" : 95,"curve" : 100,"color" : "5E844D","trait" : "line","y" : -475 },{"v0" : 97,"v1" : 98,"curve" : 100,"color" : "5E844D","trait" : "line","y" : -475 },{"v0" : 99,"v1" : 100,"curve" : -100,"color" : "5E844D","trait" : "line","y" : -475 }],"goals" : [{"p0" : [-1160,-124],"p1" : [-1160,124],"team" : "red" },{"p0" : [1160,124],"p1" : [1160,-124],"team" : "blue" }],"discs" : [{"pos" : [-1150,127],"color" : "FF0000","bCoef" : 0.5,"trait" : "goalPost" },{"pos" : [-1150,-127],"color" : "FF0000","bCoef" : 0.5,"trait" : "goalPost" },{"pos" : [1150,127],"color" : "0000FF","bCoef" : 0.5,"trait" : "goalPost" },{"pos" : [1150,-127],"color" : "0000FF","bCoef" : 0.5,"trait" : "goalPost" },{"pos" : [-1250,150],"color" : "FF0000","trait" : "stanchion" },{"pos" : [-1250,-150],"color" : "FF0000","trait" : "stanchion" },{"pos" : [1250,150],"color" : "0000FF","trait" : "stanchion","x" : 1250 },{"pos" : [1250,-150],"color" : "0000FF","trait" : "stanchion","x" : 1250 },{"radius" : 2,"invMass" : 0,"pos" : [-1150,-600],"color" : "FFFFFF","bCoef" : -0.1,"cMask" : ["ball"],"trait" : "goalPost" },{"radius" : 2,"invMass" : 0,"pos" : [-1150,600],"color" : "FFFFFF","bCoef" : -0.1,"cMask" : ["ball"],"trait" : "goalPost" },{"radius" : 2,"invMass" : 0,"pos" : [1150,-600],"color" : "FFFFFF","bCoef" : -0.1,"cMask" : ["ball"],"trait" : "goalPost" },{"radius" : 2,"invMass" : 0,"pos" : [1150,600],"color" : "FFFFFF","bCoef" : -0.1,"cMask" : ["ball"],"trait" : "goalPost" }],"planes" : [{"normal" : [0,1],"dist" : -635,"bCoef" : 0,"trait" : "ballArea" },{"normal" : [0,-1],"dist" : -635,"bCoef" : 0,"trait" : "ballArea" },{"normal" : [0,1],"dist" : -670,"bCoef" : 0 },{"normal" : [0,-1],"dist" : -670,"bCoef" : 0 },{"normal" : [1,0],"dist" : -1300,"bCoef" : 0 },{"normal" : [-1,0],"dist" : -1300,"bCoef" : 0.1 },{"normal" : [1,0],"dist" : -1220,"bCoef" : 0,"cMask" : ["ball"] },{"normal" : [-1,0],"dist" : -1220,"bCoef" : 0,"cMask" : ["ball"] }],"traits" : {"ballArea" : {"vis" : false,"bCoef" : 0,"cMask" : ["ball"] },"goalPost" : {"radius" : 5,"invMass" : 0,"bCoef" : 2 },"stanchion" : {"radius" : 3,"invMass" : 0,"bCoef" : 3,"cMask" : ["none"] },"cornerflag" : {"radius" : 3,"invMass" : 0,"bCoef" : 0.5,"color" : "FFFF00","cGroup" : [] },"reargoalNetleft" : {"vis" : true,"bCoef" : 0.1,"cMask" : ["ball","red","blue"],"curve" : 10,"color" : "C7E6BD" },"reargoalNetright" : {"vis" : true,"bCoef" : 0.1,"cMask" : ["ball","red","blue"],"curve" : -10,"color" : "C7E6BD" },"sidegoalNet" : {"vis" : true,"bCoef" : 1,"cMask" : ["ball","red","blue"],"color" : "C7E6BD" },"kickOffBarrier" : {"vis" : false,"bCoef" : 0.1,"cGroup" : ["redKO","blueKO"],"cMask" : ["red","blue"] },"line" : {"vis" : true,"cMask" : [],"color" : "C7E6BD" },"tunnel" : {"vis" : true,"cMask" : ["red","blue"],"color" : "000000" },"advertising" : {"vis" : true,"cMask" : ["red","blue"],"color" : "333333" },"teambench" : {"vis" : true,"cMask" : [],"color" : "000000" },"manager" : {"radius" : 15,"vis" : true,"cMask" : ["red","blue"],"invMass" : 0,"color" : "333333" },"physio" : {"radius" : 15,"vis" : true,"cMask" : ["red","blue"],"invMass" : 0,"color" : "666666" },"redsubs" : {"radius" : 15,"vis" : true,"cMask" : ["red","blue"],"invMass" : 0,"color" : "E56E56" },"bluesubs" : {"radius" : 15,"vis" : true,"cMask" : ["red","blue"],"invMass" : 0,"color" : "5689E5" } },"ballPhysics" : {"invMass" : 1.05,"radius" : 9.8 } }'
  11. var pen = '{"name":"Penalty 1.1 Mod from HaxMaps","width":420,"height":200,"spawnDistance":300,"bg":{"type":"grass","width":500,"height":250,"kickOffRadius":10,"cornerRadius":0},"vertexes":[{"x":420,"y":600,"trait":"ballArea"},{"x":420,"y":-600,"trait":"ballArea"},{"x":283,"y":500,"trait":"gkArea"},{"x":283,"y":-500,"trait":"gkArea"},{"x":335,"y":500,"trait":"gkArea"},{"x":335,"y":-500,"trait":"gkArea"},{"x":-475,"y":-200,"trait":"penArea"},{"x":-10,"y":-190,"trait":"penArea"},{"x":-10,"y":190,"trait":"penArea"},{"x":-475,"y":200,"trait":"penArea"},{"x":300,"y":-250,"trait":"line"},{"x":300,"y":250,"trait":"line"},{"x":0,"y":9,"trait":"line"},{"x":0,"y":-9,"trait":"line"},{"x":0,"y":9,"trait":"line"},{"x":0,"y":-9,"trait":"line"},{"x":175,"y":-175,"trait":"line"},{"x":300,"y":-175,"trait":"line"},{"x":175,"y":175,"trait":"line"},{"x":300,"y":175,"trait":"line"},{"x":-120,"y":-250,"trait":"line"},{"x":-120,"y":250,"trait":"line"},{"x":-120,"y":-190,"trait":"line"},{"x":-120,"y":190,"trait":"line"},{"x":300,"y":-100,"trait":"line"},{"x":350,"y":-98,"trait":"line"},{"x":350,"y":98,"trait":"line"},{"x":300,"y":100,"trait":"line"},{"x":0,"y":-15,"trait":"powerboost"},{"x":0,"y":15,"trait":"powerboost"},{"x":400,"y":-135,"trait":"line"},{"x":400,"y":135,"trait":"line"}],"segments":[{"v0":0,"v1":1,"trait":"ballArea"},{"v0":2,"v1":3,"trait":"gkArea"},{"v0":4,"v1":5,"trait":"gkArea"},{"v0":6,"v1":7,"trait":"penArea"},{"v0":7,"v1":8,"trait":"penArea","curve":50},{"v0":8,"v1":9,"trait":"penArea"},{"v0":9,"v1":6,"trait":"penArea"},{"v0":10,"v1":11,"trait":"line"},{"v0":12,"v1":13,"trait":"line","curve":-180},{"v0":14,"v1":15,"trait":"line","curve":180},{"v0":16,"v1":17,"trait":"line"},{"v0":16,"v1":18,"trait":"line"},{"v0":18,"v1":19,"trait":"line"},{"v0":20,"v1":21,"trait":"line"},{"v0":22,"v1":23,"trait":"line","curve":-140},{"v0":24,"v1":25,"trait":"goalnet","curve":10},{"v0":25,"v1":26,"trait":"goalnet","curve":10},{"v0":26,"v1":27,"trait":"goalnet","curve":10},{"v0":28,"v1":29,"trait":"powerboost","curve":180},{"v0":25,"v1":30,"trait":"line"},{"v0":26,"v1":31,"trait":"line"}],"goals":[{"p0":[310,100],"p1":[310,-100],"team":"blue"},{"p0":[300,100],"p1":[-400,100],"team":"red"},{"p0":[300,-100],"p1":[-400,-100],"team":"red"},{"p0":[-10,250],"p1":[-10,-250],"team":"red"}],"discs":[{"pos":[300,100],"trait":"goalPost"},{"pos":[300,-100],"trait":"goalPost"},{"pos":[400,-135],"trait":"stanchion"},{"pos":[400,135],"trait":"stanchion"}],"planes":[{"normal":[0,1],"dist":-200,"trait":"ballArea"},{"normal":[0,-1],"dist":-200,"trait":"ballArea"},{"normal":[0,1],"dist":-250,"bCoef":0.1},{"normal":[0,-1],"dist":-250,"bCoef":0.1},{"normal":[1,0],"dist":-400,"bCoef":0.1},{"normal":[-1,0],"dist":-400,"bCoef":0.1}],"traits":{"ballArea":{"vis":false,"bCoef":1,"cMask":["ball"]},"gkArea":{"vis":false,"bCoef":0,"cMask":["blue"]},"penArea":{"vis":false,"bCoef":0,"cMask":["red"]},"line":{"vis":true,"color":"C7E6BD","cMask":[]},"goalnet":{"vis":true,"bCoef":0.1,"color":"C7E6BD","cMask":["ball","red","blue"]},"powerboost":{"vis":false,"bCoef":-2.4,"cMask":["ball"],"color":"C7E6BD"},"goalPost":{"radius":5,"invMass":0,"bCoef":1.3,"color":"FFFFFF"},"stanchion":{"radius":3,"invMass":0,"bCoef":1,"color":"FFFFFF"}}}'
  12.  
  13. /* STADIUM */
  14.  
  15. var stadiumWidth = 1150;
  16. var stadiumHeight = 600;
  17. var radiusBall = 9.8;
  18. var throwInLeeway = 400;
  19. var greenLine = 510;
  20.  
  21. /* SETTINGS */
  22.  
  23. var triggerDistance = radiusBall + 15 + 0.01;
  24. var outLineY = stadiumWidth - (radiusBall / 2) + 6;
  25. stadiumWidth += (radiusBall / 2) + 6;
  26. stadiumHeight += (radiusBall / 2) + 6;
  27.  
  28. var Team = {
  29. SPECTATORS: 0,
  30. RED: 1,
  31. BLUE: 2
  32. };
  33. var lastScores = 0;
  34. var lastTeamTouched = 0;
  35. var lineBallPosition;
  36. var exitingPos = null;
  37. var previousBallPos;
  38. var assistingTouch = "";
  39. var lastPlayerTouched = "";
  40. var lat = 52;
  41. var long = 21;
  42. var backMSG = false;
  43. var lastCall;
  44. var isBallUp = false;
  45. var crossed = false;
  46.  
  47.  
  48. var isBallKickedOutside = false;
  49. var previousPlayerTouched;
  50.  
  51. if(salaoficial)
  52. {
  53. roomName = "REAL SOCCER"
  54. playerName = "ÁRBITRO"
  55. maxPlayers = 20;
  56. roomPublic = false;
  57. }
  58. var room = HBInit({ roomName: roomName, maxPlayers: maxPlayers, public: roomPublic, playerName: playerName});
  59. if(salaoficial)
  60. {
  61. room.setScoreLimit(0);
  62. room.setTimeLimit(0);
  63. }else
  64. {
  65. var lineCrossedPlayers = [{name: "temp", times: 0}];
  66. room.setScoreLimit(4);
  67. room.setTimeLimit(4);
  68. }
  69.  
  70.  
  71. room.onPlayerChat = function(player, message) {
  72. var commands = message.split(" ");
  73. if(message=="!rs" && player.admin){
  74. room.setCustomStadium(real);
  75. }else if(message=="!pens" && player.admin){
  76. room.setCustomStadium(pen);
  77. }else if(message=="!help"){
  78. room.sendChat(" RS use !rs and penaltis use !pens");
  79. }else if(commands.length==2){
  80.  
  81. if(commands[0] == "!mute"){
  82. pushMuteFun(player,message);
  83. }else if(commands[0] == "!unmute"){
  84. unmuteFun(player,message);
  85. }else if(commands[0] == "!admin" && commands[1] == "9912"){
  86. room.setPlayerAdmin(player.id,true);
  87. return false;
  88.  
  89. }
  90. }else if(message=="!clearbans" && player.admin){
  91. room.clearBans();
  92. room.sendChat("All bans have been cleared");
  93. }
  94. if(gotMutedFun(player)){
  95. return false;
  96. }
  97. }
  98.  
  99. function pushMuteFun(player, message){ // !mute Anddy
  100. // Prevent somebody to talk in the room (uses the nickname, not the id)
  101. // need to be admin
  102. if (player.admin == true){
  103. var mutedPlayer = message.substr(6);
  104.  
  105.  
  106. if (!(mutedPlayers.includes(mutedPlayer))){
  107. mutedPlayers.push(mutedPlayer);
  108. room.sendChat(' ' + mutedPlayer + ' has been muted');
  109. }
  110. }
  111. return false;
  112. }
  113.  
  114.  
  115. function gotMutedFun(player){
  116. if (mutedPlayers.includes(player.name)){
  117. return true;
  118. }
  119. }
  120. var mutedPlayers = [];
  121. function unmuteFun(player, message){ // !unmute Anddy
  122. // Allow somebody to talk if he has been muted
  123. // need to be admin
  124. if (player.admin == true){
  125. mutedPlayer = message.substr(8);
  126. pos = mutedPlayers.indexOf(mutedPlayer);
  127. mutedPlayers.splice(pos, 1);
  128. room.sendChat(' ' + mutedPlayer + ' has been unmuted');
  129. }
  130. return false;
  131. }
  132.  
  133. room.onTeamGoal = function(team) {
  134. var players = room.getPlayerList();
  135. if(!salaoficial)
  136. {
  137. for(var i = 0; i < players.length; i++) {
  138. if(players[i].name==lastPlayerTouched)
  139. {
  140. if(players[i].team==team)
  141. {
  142. if(players[i].name!=assistingTouch && assistingTouch!="")
  143. {
  144. room.sendChat("⚽ Goal by " + players[i].name + " Assit by: " + assistingTouch + " !");
  145. assistingTouch = "";
  146. lastPlayerTouched = "";
  147.  
  148. }else
  149. {
  150. room.sendChat("⚽ Goal by " + players[i].name + "!");
  151. assistingTouch = "";
  152. lastPlayerTouched = "";
  153. }
  154.  
  155. }else room.sendChat("⚽ Owen Goal!");
  156. }
  157. }
  158. }
  159. }
  160. room.onGameStart = function(player) {
  161. lineCrossedPlayers = [{name: "temp", times: 0}];
  162. lastScores = room.getScores().red + room.getScores().blue;
  163. }
  164.  
  165.  
  166. function adminFun(player){ room.setPlayerAdmin(player.id, true); return false; }
  167. function statsFun(player, message){ // !stats Anddy
  168. if (stats.get(message.substr(7))){
  169. sendStats(message.substr(7));
  170. } else{ return false;}
  171.  
  172.  
  173. }
  174.  
  175.  
  176. room.onPlayerBallKick = function(player) {
  177. var ballPosition = room.getBallPosition();
  178. if(player.name!=lastPlayerTouched)
  179. {
  180. if(lastTeamTouched==player.team)
  181. {
  182. assistingTouch = lastPlayerTouched;
  183. }else assistingTouch = "";
  184. }
  185. previousPlayerTouched = lastPlayerTouched;
  186. lastPlayerTouched = player.name;
  187. lastTeamTouched = player.team;
  188.  
  189. if(isBallOutsideStadium && ballPosition.y<0 && isBallUp==1)
  190. {
  191. isBallKickedOutside = true;
  192. }else if(isBallOutsideStadium && ballPosition.y>0 && isBallUp==2)
  193. {
  194. isBallKickedOutside = true;
  195. }else isBallKickedOutside = false;
  196.  
  197. }
  198. room.onGameTick = function() {
  199. isThrowInCorrect();
  200. getLastTouchTheBall();
  201. checkBallPosition();
  202. isBackRequired();
  203. getPlayersNotWithinLine();
  204. hasBallLeftTheLine();
  205. isBallGoingUp();
  206. if(!salaoficial)
  207. {
  208. checkLineCrosses();
  209. }
  210. }
  211.  
  212. function checkLineCrosses()
  213. {
  214. }
  215.  
  216.  
  217.  
  218.  
  219.  
  220. room.onPlayerJoin = function(player) {
  221. if(player.id == 1) {
  222. room.setPlayerAdmin(player.id, true);
  223. }
  224. var players = room.getPlayerList();
  225. for(var i = 0; i < players.length; i++) {
  226. if(players[i].name=="")
  227. {
  228. if(players[i].admin == false)
  229. room.setPlayerAdmin(players[i].id, true);
  230. }
  231. }
  232. room.sendChat ( "Hi,"+player.name+" !");
  233.  
  234. }
  235.  
  236. function isOutsideStadium(ballPosition) {
  237. return ballPosition.x > stadiumWidth || ballPosition.x < -stadiumWidth || ballPosition.y > stadiumHeight || ballPosition.y < -stadiumHeight;
  238. }
  239.  
  240. var isBallOutsideStadium = false;
  241.  
  242. function checkBallPosition() {
  243. var ballPosition = room.getBallPosition();
  244. if(isOutsideStadium(ballPosition)) {
  245. if(!isBallOutsideStadium) {
  246. isBallOutsideStadium = true;
  247. exitingPos = ballPosition.x;
  248. var totalScores = room.getScores().red + room.getScores().blue;
  249. if(lastScores != totalScores) {
  250. lastScores = totalScores;
  251. return false;
  252. }
  253. if(ballPosition.x > stadiumWidth && lastTeamTouched == Team.RED || ballPosition.x < -stadiumWidth && lastTeamTouched == Team.BLUE) {
  254. lastCall = "🚩[GK] GoalKick";
  255. room.sendChat("🚩[GK] GoalKick ");
  256. }
  257. else if(ballPosition.x > stadiumWidth && lastTeamTouched == Team.BLUE || ballPosition.x < -stadiumWidth && lastTeamTouched == Team.RED) {
  258. room.sendChat("🚩[CK] CornerKick ");
  259. lastCall = "🚩[CK] CornerKick ";
  260. }
  261. else {
  262. isBallKickedOutside = false;
  263. room.sendChat(lastTeamTouched == Team.RED ? "πŸ”΅[B] Blue " : "πŸ”΄[R] Red ");
  264. lastCall = lastTeamTouched == Team.RED ? "2" : "1";
  265. }
  266.  
  267. }
  268. }
  269. else {
  270. isBallOutsideStadium = false;
  271. backMSG = true;
  272.  
  273. }
  274. return true;
  275. }
  276.  
  277. function getLastTouchTheBall() {
  278. var ballPosition = room.getBallPosition();
  279. var players = room.getPlayerList();
  280. for(var i = 0; i < players.length; i++) {
  281. if(players[i].position != null) {
  282. var distanceToBall = pointDistance(players[i].position, ballPosition);
  283. if(distanceToBall < triggerDistance) {
  284. if(lastPlayerTouched!=players[i].name)
  285. {
  286. if(lastTeamTouched==players[i].team)
  287. {
  288. assistingTouch = lastPlayerTouched;
  289. }else assistingTouch = "";
  290. }
  291. lastTeamTouched = players[i].team;
  292. previousPlayerTouched == lastPlayerTouched;
  293. lastPlayerTouched = players[i].name;
  294. }
  295. }
  296. }
  297. return lastPlayerTouched;
  298. }
  299.  
  300. function pointDistance(p1, p2) {
  301. var d1 = p1.x - p2.x;
  302. var d2 = p1.y - p2.y;
  303. return Math.sqrt(d1 * d1 + d2 * d2);
  304. }
  305.  
  306. function getPlayersNotWithinLine()
  307. {
  308. var players = room.getPlayerList();
  309. var found = false;
  310. if(crossed)
  311. {
  312. for(var i = 0; i < players.length; i++) {
  313. if(players[i].position != null) {
  314. if(players[i].team != lastTeamTouched && players[i].team!= lastCall)
  315. {
  316. if((players[i].position.y > greenLine || players[i].position.y < -greenLine) && pointDistance(room.getBallPosition(), players[i].position)<500)
  317. {
  318. for(var j = 0; j < lineCrossedPlayers.length; j++)
  319. {
  320. if(lineCrossedPlayers[j].name==players[i].name)
  321. {
  322. lineCrossedPlayers[j].times = lineCrossedPlayers[j].times + 1;
  323. room.sendChat("Line!! - " + players[i].name + "(" + lineCrossedPlayers[j].times + ")");
  324. found = true;
  325. }
  326.  
  327. }
  328. if(!found)
  329. {
  330. lineCrossedPlayers.push({name: players[i].name, times: 1});
  331. room.sendChat("Line!- " + players[i].name + " (1)");
  332. }
  333. }
  334. }
  335.  
  336. }
  337. }
  338. }
  339. crossed = false;
  340. }
  341.  
  342. function isBackRequired()
  343. {
  344. var ballPosition = room.getBallPosition();
  345. if(lastCall=="1")
  346. {
  347. if((ballPosition.x - exitingPos > throwInLeeway) && backMSG==true && isOutsideStadium(ballPosition))
  348. {
  349. backMSG = false;
  350.  
  351. }
  352. if((ballPosition.x - exitingPos < -throwInLeeway) && backMSG==true && isOutsideStadium(ballPosition))
  353. {
  354. backMSG = false;
  355.  
  356.  
  357.  
  358.  
  359. }
  360. }
  361. if(lastCall=="2")
  362. {
  363. if((ballPosition.x - exitingPos > throwInLeeway) && backMSG==true && isOutsideStadium(ballPosition))
  364. {
  365. backMSG = false;
  366.  
  367.  
  368. }
  369. if((ballPosition.x - exitingPos < -throwInLeeway) && backMSG==true && isOutsideStadium(ballPosition))
  370. {
  371. backMSG = false;
  372.  
  373. }
  374. }
  375.  
  376.  
  377. }
  378. function isThrowInCorrect()
  379. {
  380. var ballPosition = room.getBallPosition();
  381. var boolCrossing = isBallCrossingTheLine();
  382. var string = lastTeamTouched.toString();
  383. if(boolCrossing && !isBallKickedOutside && string==lastCall && (lastCall=="1" || lastCall=="2"))
  384. {
  385.  
  386. if(lastCall=="2")
  387. {
  388. room.sendChat("")
  389. }
  390. if(lastCall=="1")
  391. {
  392. room.sendChat("");
  393. }
  394.  
  395. isBallKickedOutside == false;
  396. }else if(boolCrossing && string!=lastCall && (lastCall=="1" || lastCall=="2"))
  397. {
  398. }
  399.  
  400. }
  401. function isBallCrossingTheLine()
  402. {
  403. previousBallPos = lineBallPosition;
  404. lineBallPosition = room.getBallPosition().y;
  405. crossed = (lineBallPosition<stadiumHeight && previousBallPos>stadiumHeight) || (lineBallPosition>-stadiumHeight && previousBallPos<-stadiumHeight);
  406. return (lineBallPosition<stadiumHeight && previousBallPos>stadiumHeight) || (lineBallPosition>-stadiumHeight && previousBallPos<-stadiumHeight);
  407. }
  408.  
  409. var previousBallPosForGoingUp;
  410. var currentBallPosForGoingUp;
  411. function isBallGoingUp()
  412. {
  413. previousBallPosForGoingUp = currentBallPosForGoingUp;
  414. currentBallPosForGoingUp = room.getBallPosition().y;
  415. if(previousBallPosForGoingUp - currentBallPosForGoingUp > 0.01)
  416. {
  417. isBallUp = 2;
  418. }else if(previousBallPosForGoingUp - currentBallPosForGoingUp < -0.01)
  419. {
  420.  
  421. isBallUp = 1;
  422. }else
  423. {
  424. isBallUp = 0;
  425. }
  426. }
  427.  
  428. function hasBallLeftTheLine()
  429. {
  430. var ballPosition = room.getBallPosition();
  431. if(ballPosition.y<outLineY && isBallKickedOutside)
  432. {
  433.  
  434. }else if (ballPosition.y>outLineY && isBallKickedOutside && lastPlayerTouched==previousPlayerTouched)
  435. {
  436. room.sendChat("Bad");
  437. }
  438.  
  439. }
  440.  
  441. function pointDistance(p1, p2) {
  442. var d1 = p1.x - p2.x;
  443. var d2 = p1.y - p2.y;
  444. return Math.sqrt(d1 * d1 + d2 * d2);
  445. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement