Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

NoMessage

Comments in 'Plugin Development' started by VoBIs, May 2, 2016.

  1. VoBIs
    Offline

    VoBIs New Member

    Joined:
    Jun 20, 2015
    Posts:
    18
    Minecraft User:
    VoBIs
    <?php

    namespace FIRERO;

    use pocketmine\item\Item;
    use pocketmine\Player;
    use pocketmine\Server;
    use pocketmine\utils\TextFormat;
    use pocketmine\event\Listener;
    use pocketmine\plugin\PluginBase;
    use pocketmine\command\CommandSender;
    use pocketmine\command\Command;

    class xp extends PluginBase implements Listener {


    public function onEnable() {
    $this->getServer()->getPluginManager()->registerEvents($this, $this);
    $this->getServer()->loadLevel("spawn");
    }

    public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){
    if((strtolower($cmd->getName()) == "buyxp")){
    $sender->getInventory()->removeItem(Item::get(351, 4, 10));
    $sender->addExperience(10);
    $sender->sendMessage("Покупка Опыта > Вы успешно приобрели опыт! Приятного зачарования :3");
    }else{
    $sender->sendMessage("Покупка Опыта > Ошибка: для покупки опыта нужно 10 шт. лазурита.");
    }
    }
    }


    WTF!? Sends an empty message...
    Last edited: May 2, 2016
  2. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    I believe sendTip doesn't work.
    Vaivez66 likes this.
  3. VoBIs
    Offline

    VoBIs New Member

    Joined:
    Jun 20, 2015
    Posts:
    18
    Minecraft User:
    VoBIs
    Oh... I forgot for this))) It's test version.

Share This Page

Advertisement