-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef85932
commit 585cb45
Showing
2 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: StealthPvPVanish | ||
main: Panda\Vanish\Vanish | ||
author: JusztPandaa | ||
description: "StealthPvP Vanish plugin" | ||
api: [3.0.0] | ||
version: 2.0 | ||
|
||
commands: | ||
vanish: | ||
description: "Go into Vanish" | ||
permission: vanish.use | ||
v: | ||
description: "Go into Vanish" | ||
permission: vanish.use | ||
unvanish: | ||
description: "Come out of Vanish" | ||
permission: vanish.use | ||
unv: | ||
description: "Come out of Vanish" | ||
permission: vanish.use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
|
||
namespace Panda\Vanish; | ||
|
||
use pocketmine\plugin\PluginBase; | ||
use pocketmine\event\player\PlayerJoinEvent; | ||
use pocketmine\event\player\PlayerQuitEvent; | ||
|
||
use pocketmine\Player; | ||
|
||
use pocketmine\Server; | ||
use pocketmine\command\Command; | ||
use pocketmine\command\CommandSender; | ||
|
||
use pocketmine\event\Listener; | ||
|
||
use pocketmine\utils\TextFormat; | ||
use pocketmine\event\player\PlayerGameModeChangeEvent; | ||
|
||
class Vanish extends PluginBase implements Listener{ | ||
|
||
public function onLoad(){ | ||
$this->getLogger()->info("StealthPvP vanish version 1.0 loading...."); | ||
} | ||
public function onEnable(){ | ||
$this->getServer()->getPluginManager()->registerEvents($this, $this); | ||
$this->getLogger()->info("StealthPvP vanish has been Enabled!"); | ||
} | ||
|
||
public function onDisable(){ | ||
$this->getLogger()->info("StealthPvP vanish has been Disabled!"); | ||
} | ||
|
||
public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args): bool{ | ||
switch($cmd->getName()){ | ||
case "vanish": | ||
if(!$sender instaceof Player){ | ||
sender->sendMessage("Use this command InGame!"); | ||
return false; | ||
} | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§7[!] You have been put into vanish!"); | ||
$sender->sendTip("You are currently §cVANISHED"); | ||
$sender->setGamemode(3); | ||
} | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§cUnkown command. Please use /help for a list of commands."); | ||
} | ||
break; | ||
|
||
case "v": | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§7[!] You have been put into vanish!"); | ||
$sender->sendTip("You are currently §cVANISHED"); | ||
$sender->setGamemode(3); | ||
} | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§cUnkown command. Please use /help for a list of commands.") | ||
} | ||
break; | ||
|
||
case "unvanish": | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§7[!] You have been taken out of vanish"); | ||
$sender->setGamemode(2); | ||
} | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§cUnkown command. Please use /help for a list of commands.") | ||
} | ||
break; | ||
|
||
case "unv": | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§7[!] You have been taken out of vanish"); | ||
$sender->setGamemode(2); | ||
} | ||
if($sender->hasPermission("vanish.use")){ | ||
$sender->sendMessage("§cUnkown command. Please use /help for a list of commands.") | ||
} | ||
break; | ||
} | ||
return true; | ||
} | ||
} |