design improvement custom votes plugin

This commit is contained in:
kremsy 2014-01-14 19:20:03 +01:00 committed by Steffen Schröder
parent fe1f4c6be4
commit 476e3464e5

View File

@ -249,26 +249,25 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
switch($voteName) { switch($voteName) {
case 'teambalance': case 'teambalance':
$this->maniaControl->client->query('AutoTeamBalance'); $this->maniaControl->client->query('AutoTeamBalance');
$this->maniaControl->chat->sendInformation('Vote Successfully -> Teams got Balanced!'); $this->maniaControl->chat->sendInformation('$sVote Successfully -> Teams got Balanced!');
break; break;
case 'skipmap': case 'skipmap':
case 'nextmap': case 'nextmap':
$this->maniaControl->client->query('NextMap'); $this->maniaControl->client->query('NextMap');
$this->maniaControl->chat->sendInformation('Vote Successfully -> Map skipped!'); $this->maniaControl->chat->sendInformation('$sVote Successfully -> Map skipped!');
break; break;
case 'restartmap': case 'restartmap':
$this->maniaControl->client->query('RestartMap'); $this->maniaControl->client->query('RestartMap');
$this->maniaControl->chat->sendInformation('Vote Successfully -> Map restarted!'); $this->maniaControl->chat->sendInformation('$sVote Successfully -> Map restarted!');
break; break;
case 'pausegame': case 'pausegame':
$this->maniaControl->client->query('SendModeScriptCommands', array('Command_ForceWarmUp' => True)); $this->maniaControl->client->query('SendModeScriptCommands', array('Command_ForceWarmUp' => True));
$this->maniaControl->chat->sendInformation('Vote Successfully -> Current Game paused!'); $this->maniaControl->chat->sendInformation('$sVote Successfully -> Current Game paused!');
break; break;
} }
} else { } else {
$this->maniaControl->chat->sendInformation('Vote Failed!'); $this->maniaControl->chat->sendError('Vote Failed!');
} }
} }
/** /**
@ -339,7 +338,6 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$maxTime = $this->maniaControl->settingManager->getSetting($this, self::SETTING_VOTE_TIME); $maxTime = $this->maniaControl->settingManager->getSetting($this, self::SETTING_VOTE_TIME);
$this->maniaControl->chat->sendChat("Vote started");
$this->currentVote = $this->voteCommands[$voteIndex]; $this->currentVote = $this->voteCommands[$voteIndex];
$this->currentVoteExpireTime = time() + $maxTime; $this->currentVoteExpireTime = time() + $maxTime;
@ -347,6 +345,8 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$this->playersVotedPositiv++; $this->playersVotedPositiv++;
$this->voter = $player; $this->voter = $player;
$this->maniaControl->chat->sendSuccess('$<' . $player->nickname . '$>$s started a $<' . $this->currentVote['Name'] . '$> vote!');
} }
/** /**