Пример #1
0
 private function _showAwardsMsg($player = NULL)
 {
     $buffer = array();
     $eventAwards = array();
     $_awards = Server::get('awards');
     $gametype = Server::getServer()->serverInfo['g_gametype'];
     //On affiche l'award uniquement si il est activé dans la config
     foreach ($this->config['ShowAwards'] as $award) {
         if (in_array($award, $this->config['ShowAwards']) && ($award == 'caps' && $gametype == Server::GAME_CTF or $award == 'round' && $gametype == Server::GAME_LMS or !in_array($award, array('round', 'caps')))) {
             if ($_awards[$award][0] !== NULL) {
                 $buffer[] = ucfirst($award) . ' : ^2' . Server::getPlayer($_awards[$award][0])->name;
             } else {
                 $buffer[] = ucfirst($award) . ' : ^7-----';
             }
             if ($award == 'ratio') {
                 $eventAwards[$award] = round($_awards[$award], 2);
             } else {
                 $eventAwards[$award] = $_awards[$award];
             }
         }
     }
     if ($player === NULL) {
         Rcon::say('Awards : $awards', array('awards' => join('^3 - ', $buffer)));
         $this->_plugins->callEventSimple('stats', 'showawards', $eventAwards);
     } else {
         Rcon::tell($player, 'Awards : $awards', array('awards' => join('^3 - ', $buffer)));
     }
 }
Пример #2
0
 public function SrvEventHit($player, $shooter, $partOfBody, $weapon)
 {
     $shooter = Server::getPlayer($shooter);
     $player = Server::getPlayer($player);
     $gametype = Server::getServer()->serverInfo['g_gametype'];
     if ($shooter->team == $player->team and !in_array($gametype, array(Server::GAME_FFA, Server::GAME_LMS))) {
         $warns = $this->_addWarn($shooter->id, $player->id);
         Rcon::say('Warning : $shooter has team hit $player ! (He has $warns warnings)', array('shooter' => $shooter->name, 'player' => $player->name, 'warns' => $warns));
         Rcon::tell($player->id, 'Please type !fp if you want to forgive him.');
     }
 }