added isMuted() function to the player object + some adds what a player cant do when muted (use chatmessages like /gg, add map to queue, start a vote...)

This commit is contained in:
kremsy
2014-08-24 12:28:16 +02:00
parent afa15217a2
commit ffa3506879
7 changed files with 307 additions and 263 deletions

View File

@ -443,9 +443,8 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
* @param callable $function calls the given function only if the vote is successful and returns as Parameter the Voting-Results
*/
public function startVote(Player $player, $voteIndex, $function = null) {
//Player is muted
if ($this->maniaControl->getPlayerManager()->getPlayerActions()->isPlayerMuted($player)
) {
// Check if the Player is muted
if ($player->isMuted()) {
$this->maniaControl->getChat()->sendError('Muted Players are not allowed to start a vote.', $player);
return;
}