This works PHP: $this->getServer()->getPluginManager()->getPlugin("EconomyAPI")->addMoney($player, 100);
Found PHP: $this->getServer()->getPluginManager()->getPlugin("EconomyAPI")->reduceMoney($player, 100);
I would like to know how to make it so that the player's wallet is below the price allor tell him no you did not asser instead of $wallet I want the player's account amount PHP: $price = 50; if ($wallet < $price) { $sender->sendMessage("Yes"); } else { $sender->sendMessage("No"); } } return true;
help PHP: public function onCommand(CommandSender $player, Command $command, String $label, array $args) : bool { switch($command->getName()){ case "buyenchant": $price = 50; $wallet = EconomyAPI::myMoney($player); if ($wallet < $price) { $sender->sendMessage("Yes"); } else { $sender->sendMessage("No"); } return true; } }
public function onCommand(CommandSender $sender, Command $command, String $label, array $args) : bool { switch($command->getName()){ case "buyenchant": $cost = 50; if(EconomyAPI::getInstance()->myMoney($sender) > $cost){ $sender->sendMessage("Bought"); EconomyAPI::getInstance()->reduceMoney($sender, $cost); }else{ $sender->sendMessage("No money"); }