I wanted to point out how people are using PM Forum like there's no stack overflow forum to help them with PHP QnAs.
PHP: /** Minium money */const MIN_MONEY = 100000;/** Maximum money */const MAX_MONEY = 400000;/** @var array */private $array = array();/*** @param Player $player*/public function sendMoney(Player $player) { $money = rand(self::MIN_MONEY, self::MAX_MONEY); array_push($this->array, $money); // I didn't had EconomyAPI plugin when writting this so i couldn't check if it was loaded EconomyAPI::getInstance()->addMoney($player, $this->array); $player->sendMessage("You won {$this->array[0]}$"); array_shift($this->array);}
The second parameter of addMoney() only accepts integers numeric values. Why not just do: PHP: public function payRandomAmount(Player $p){Economy::getInstance()->addMoney($p, (mt_rand(100,400)*1000));}
wops PHP: EconomyAPI::getInstance()->addMoney($player, $this->array); Change $this->array to $this->array[0]