Hi, How can I send message to everyone when the killer gets every 10 kills? Example: 10, 20, 30, etc... Here is the code that I'm trying to do it on: PHP: if ($this->plugin->getPlayerBestStreak($killer) == 10){ foreach ($this->plugin->getServer()->getOnlinePlayers() as $players){ $ks = $this->plugin->getPlayerStreak($killer); $players->sendMessage("§b".$killer->getName()."§7 has reached a streak of §a".$ks); } } Any help is appreciated.
PHP: if (in_array($this->plugin->getPlayerBestStreak($killer), [10, 20, 30, etc...])){ $ks = $this->plugin->getPlayerStreak($killer); $killer->getServer()->broadcastMessage("§b".$killer->getName()."§7 has reached a streak of §a".$ks); } }
But is there a way to get every ten instead of putting it in an array? This will be hard because I'll have to write all of the numbers in a array
PHP: $ks = $this->plugin->getPlayerBestStreak($killer); $k = 10;//you can change it to settings each kills per announcement. if(($ks > 0) && ($ks%$k == 0)) { $killer->getServer()->broadcastMessage("§b".$killer->getName()."§7 has reached a streak of §a".$ks); } Sorry for the ugly format I'm using my phone. I hope to answer your question.