i have this onCommand function but when i do /price <player> it just returns the sender price PHP: public function onCommand(CommandSender $sender, Command $cmd, $label, array $param){ if(strtolower($cmd->getName()) === "price"){ if(isset($args[0])){ $target = $this->getServer()->getPlayer($args[0]); if($target !== null && $target->isOnline()){ $sender->sendMessage("§l§c TheVortex §7>> §r§e ".$target->getName()." §7 is worth §l§a$ §r§f§a".$this->getWorth($target)); } else { $sender->sendMessage("§l§c TheVortex §7>> §r§4 ".$target->getName()." Isnt online!"); } } else { $sender->sendMessage("§l§c TheVortex §7>> §r§§§7Your head is worth §l§a$ §r§f§a".$this->getWorth($sender)); } } }}
PHP: public function onCommand(CommandSender $sender, Command $cmd, $label, array $param){ if(strtolower($cmd->getName()) === "price"){ if(isset($param[0])){ $target = $this->getServer()->getPlayer($param[0]); if($target !== null && $target->isOnline()){ $sender->sendMessage("§l§c TheVortex §7>> §r§e ".$target->getName()." §7 is worth §l§a$ §r§f§a".$this->getWorth($target)); } else { $sender->sendMessage("§l§c TheVortex §7>> §r§4 ".$target->getName()." Isnt online!"); } } else { $sender->sendMessage("§l§c TheVortex §7>> §r§§§7Your head is worth §l§a$ §r§f§a".$this->getWorth($sender)); } } }
nope it doesn't , but i did get a error when running the command , an error on explode() function even tho i never used it
Set debug.level to 2 and look at the trace. You'll hopefully see which line in your code leads to the bug.