Skip to content

Commit

Permalink
Update Main.php
Browse files Browse the repository at this point in the history
  • Loading branch information
x7khalid authored Sep 5, 2016
1 parent 606f509 commit 638c04a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/iBa4x/VIP/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public function onCommand(CommandSender $sender, Command $cmd, $label, array $ar
$x = $sender->getFloorX();
$y = $sender->getFloorY();
$z = $sender->getFloorZ();
$level = $sender->getLevel()->getName();
$this->getConfig()->set("x2", $x);
$this->getConfig()->set("y2", $y);
$this->getConfig()->set("z2", $z);
$this->getConfig()->set("Level", $level);
$this->getConfig()->save();
$sender->sendMessage(TextFormat::GREEN."- Pos2 set to: ($x, $y, $z)");
return true;
Expand All @@ -60,7 +62,8 @@ public function onMove(PlayerMoveEvent $event){
$x2 = $this->getConfig()->get("x2");
$y2 = $this->getConfig()->get("y2");
$z2 = $this->getConfig()->get("z2");
if($this->isInside($player,new Vector3($x1,$y1,$z1),new Vector3($x2,$y2,$z2))){
$level = $this->getConfig()->get("Level");
if($this->isInside($player,new Vector3($x1,$y1,$z1,$level),new Vector3($x2,$y2,$z2,$level))){
if(!$player->hasPermission("vip1b.area.vip")){
$spawn = $this->getServer()->getDefaultLevel()->getSafeSpawn();
$player->teleport(new Vector3($spawn->getX(),$spawn->getY(),$spawn->getZ()));
Expand Down

0 comments on commit 638c04a

Please sign in to comment.