docker-tmserver/xaseco/plugins/chat.wins.php

24 lines
671 B
PHP
Raw Permalink Normal View History

2022-06-26 17:43:44 +02:00
<?php
/* vim: set noexpandtab tabstop=2 softtabstop=2 shiftwidth=2: */
/**
* Chat plugin.
* Shows player wins.
* Created by Xymph
*
* Dependencies: none
*/
Aseco::addChatCommand('wins', 'Shows wins for current player');
function chat_wins($aseco, $command) {
$wins = $command['author']->getWins();
// use plural unless 1, and add ! for 2 or more
$message = formatText($aseco->getChatMessage('WINS'), $wins,
($wins == 1 ? '.' : ($wins > 1 ? 's!' : 's.')));
// show chat message
$aseco->client->query('ChatSendServerMessageToLogin', $aseco->formatColors($message), $command['author']->login);
} // chat_wins
?>