當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Shadowrun4::getHumanPlayers方法代碼示例

本文整理匯總了PHP中Shadowrun4::getHumanPlayers方法的典型用法代碼示例。如果您正苦於以下問題:PHP Shadowrun4::getHumanPlayers方法的具體用法?PHP Shadowrun4::getHumanPlayers怎麽用?PHP Shadowrun4::getHumanPlayers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Shadowrun4的用法示例。


在下文中一共展示了Shadowrun4::getHumanPlayers方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 public static function execute(SR_Player $player, array $args)
 {
     if (count($args) === 0) {
         $args[] = '1';
     }
     if (count($args) !== 1) {
         $player->message(Shadowhelp::getHelp($player, 'players'));
         return false;
     }
     $ppp = self::PPP;
     $page = (int) $args[0];
     $players = Shadowrun4::getHumanPlayers();
     $nPlayers = count($players);
     $nPages = GWF_PageMenu::getPagecount($ppp, $nPlayers);
     $from = GWF_PageMenu::getFrom($page, $ppp);
     if ($page < 1 || $page > $nPages) {
         $player->msg('1009');
         // 			$player->message(sprintf('Page %d of %d is empty.', $page, $nPages));
         return false;
     }
     $out = '';
     $format = $player->lang('fmt_sumlist');
     foreach (array_slice($players, $from, $ppp, false) as $p) {
         $p instanceof SR_Player;
         $summand = sprintf('L%s(%s)', $p->getBase('level'), $p->get('level'));
         $out .= sprintf($format, $p->getEnum(), $p->getName(), $summand);
         // 			$out .= sprintf(', %s(L%s(%s))', $p->displayName(), $p->getBase('level'), $p->get('level'));
     }
     if ($out === '') {
         $player->msg('1009');
         return false;
     }
     return self::rply($player, '5247', array($page, $nPages, ltrim($out, ',; ')));
     // 		$out = $out === '' ? 'This page is empty.' : sprintf('Active players (page %d of %d): %s.', $page, $nPages, substr($out, 2));
     // 		self::reply($player, $out);
     // 		return true;
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:37,代碼來源:players.php


注:本文中的Shadowrun4::getHumanPlayers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。