donate statistic
This commit is contained in:
parent
4412ff73c1
commit
e359c22783
@ -217,6 +217,8 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
|
|||||||
$donation = $billData[0];
|
$donation = $billData[0];
|
||||||
$amount = $billData[3];
|
$amount = $billData[3];
|
||||||
if($donation) {
|
if($donation) {
|
||||||
|
$player = $this->maniaControl->playerManager->getPlayer($login);
|
||||||
|
|
||||||
// Donation
|
// Donation
|
||||||
if(strlen($receiver) > 0) {
|
if(strlen($receiver) > 0) {
|
||||||
// To player
|
// To player
|
||||||
@ -225,12 +227,11 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
|
|||||||
} else {
|
} else {
|
||||||
// To server
|
// To server
|
||||||
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_ANNOUNCE_SERVERDONATION, true)) {
|
if($this->maniaControl->settingManager->getSetting($this, self::SETTING_ANNOUNCE_SERVERDONATION, true)) {
|
||||||
$message = '$<' . ($player ? $player->nickname : $login) . '$> donated ' . $amount . ' Planets! Thanks.';
|
$message = '$<' . $player->nickname . '$> donated ' . $amount . ' Planets! Thanks.';
|
||||||
} else {
|
} else {
|
||||||
$message = 'Donation successful! Thanks.';
|
$message = 'Donation successful! Thanks.';
|
||||||
}
|
}
|
||||||
$this->maniaControl->chat->sendSuccess($message, $login);
|
$this->maniaControl->chat->sendSuccess($message, $login);
|
||||||
$player = $this->maniaControl->playerManager->getPlayer($login);
|
|
||||||
$this->maniaControl->statisticManager->insertStat(self::STAT_PLAYER_DONATIONS, $player, $this->maniaControl->server->getLogin(), $amount);
|
$this->maniaControl->statisticManager->insertStat(self::STAT_PLAYER_DONATIONS, $player, $this->maniaControl->server->getLogin(), $amount);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user