Omg, guys help... why is this an undefined index?!? EDIT: PARTLY RESOLVED something to do with $player->getName(); Var_dump: PHP: array(5) { ["samueljh1"]=> float(5) ["samueljh1_sdf"]=> float(100) ["steve"]=> float(-500) ["samueljh1_"]=> float(1000) ["frazo_06130"]=> float(1000)} then , with this code: PHP: $path = Server::getInstance()->getDataPath() . "plugins/EconomyAPI/Money.yml"; $bc = new Config($path, Config::YAML); //var_dump($bc->get("money")); return $bc->get('money')[strtolower($p)]; THIS ERROR: Code: [CRITICAL] Unhandled exception executing command 'rankup' in rankup: Undefined index: money: samueljh1_ Its SO WEIRD! It works if I do: PHP: return $bc->get('money')['samueljh1_']; $p is samueljh1_
var_dump($bc->get("money")); this is the config: PHP: ---version: 2money: samueljh1: 5.000000 samueljh1_sdf: 100.000000 steve: -500.000000 samueljh1_: 1000.000000 frazo_06130: 1000.000000debt: samueljh1: 0.000000 samueljh1_sdf: 0.000000 samueljh1_: 0.000000 frazo_06130: 0.000000...
Hmm... Instead of PHP: $bc->get('money')[strtolower($p)]; Try with PHP: $test = $bc->getAll();return $test['money'][strtolower($p)];
its this: PHP: $sender->sendMessage($this->getPlayerMoney("Money: " . $sender->getPlayer()->getName())); and i tried this PHP: $sender->sendMessage($this->getPlayerMoney("Money: " . $sender->getName()));