protect.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. msg("dev", "§bProtect §rwurde geladen.");
  2. event.load("block-break");
  3. event.load("block-place");
  4. event.load("command");
  5. setVar("lowestpos", read.location("games:2000:0:-4000:0:0"));
  6. setVar("highestpos", read.location("games:2200:255:-3800:0:0"));
  7. list.new("fremdallowed");
  8. //list.add($fremdallowed, "_Low_Key_");
  9. @wait
  10. wait();
  11. if(list.contains($fremdallowed, $player-name)) goto ("specialhandling");
  12. goto("wait");
  13. @cancel
  14. setVar("cancel", true);
  15. goto("wait");,
  16. @specialhandling
  17. if(or(equal($event, "block-break") equal($event, "block-place"))) goto("blockaction");
  18. if(equal($event, "command")) goto("command");
  19. goto("wait");
  20. @blockaction
  21. if(notequal($world-name, "games")) goto("cancel");
  22. if(or(less(loc.getCoord($player-loc, "x"), loc.getCoord($lowestpos, "x")), less(loc.getCoord($player-loc, "y"), loc.getCoord($lowestpos, "y")), less(loc.getCoord($player-loc, "z"), loc.getCoord($lowestpos, "z")))) setVar("cancel", true);
  23. if(or(greater(loc.getCoord($player-loc, "x"), loc.getCoord($highestpos, "x")), greater(loc.getCoord($player-loc, "y"), loc.getCoord($highestpos, "y")), greater(loc.getCoord($player-loc, "z"), loc.getCoord($highestpos, "z")))) setVar("cancel", true);
  24. goto("wait");
  25. @command
  26. if(notequal(list.getSize($args), 2)) goto("wait");
  27. if(and(equal(list.getIndex($args, 0) "/warp"), equal(list.getIndex($args, 1), "hungergame"))) {
  28. setVar("cancel", false);
  29. goto ("wait");
  30. }
  31. if(notequal($world-name, "games")) goto("cancel");
  32. if(or(less(loc.getCoord($player-loc, "x"), loc.getCoord($lowestpos, "x")), less(loc.getCoord($player-loc, "y"), loc.getCoord($lowestpos, "y")), less(loc.getCoord($player-loc, "z"), loc.getCoord($lowestpos, "z")))) setVar("cancel", true);
  33. if(or(greater(loc.getCoord($player-loc, "x"), loc.getCoord($highestpos, "x")), greater(loc.getCoord($player-loc, "y"), loc.getCoord($highestpos, "y")), greater(loc.getCoord($player-loc, "z"), loc.getCoord($highestpos, "z")))) setVar("cancel", true);
  34. goto("wait");