本文整理汇总了PHP中Shadowrun4::getPlayers方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowrun4::getPlayers方法的具体用法?PHP Shadowrun4::getPlayers怎么用?PHP Shadowrun4::getPlayers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowrun4
的用法示例。
在下文中一共展示了Shadowrun4::getPlayers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRandomPlayer
public function getRandomPlayer($only = 'all')
{
$back = array();
foreach (Shadowrun4::getPlayers() as $player) {
$player instanceof SR_Player;
if ($player->isHuman() && $only !== 'npc') {
$back[] = $player;
} elseif ($player->isNPC() && $only !== 'human') {
$back[] = $player;
}
}
}
示例2: execute
public static function execute(SR_Player $player, array $args)
{
if (count($args) === 0) {
Shadowrap::instance($player)->reply(Shadowhelp::getHelp($player, 'gmn'));
return false;
}
$message = "[Shadowlamb] " . implode(' ', $args);
foreach (Shadowrun4::getPlayers() as $player) {
$player instanceof SR_Player;
$player->message($message);
}
return true;
}