本文整理汇总了PHP中pocketmine\command\CommandSender::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP CommandSender::getId方法的具体用法?PHP CommandSender::getId怎么用?PHP CommandSender::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\command\CommandSender
的用法示例。
在下文中一共展示了CommandSender::getId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: marryCommand
function marryCommand(CommandSender $sender, array $args)
{
if (count($args) !== 1) {
$sender->sendMessage($this->getMessage("l.marry.usage"));
return true;
}
if ($this->provider->isMarried($sender->getName())) {
$sender->sendMessage($this->getMessage("l.married"));
return true;
}
if ($this->provider->isMarried($args[0])) {
$sender->sendMessage($this->getMessage("l.is-married", $args[0]));
return true;
}
if (strtolower($sender->getName()) == strtolower($args[0])) {
$sender->sendMessage($this->getMessage("no-marry-you"));
return true;
}
$this->updateQueries();
if (isset($this->queries[strtolower($sender->getName())])) {
$sender->sendMessage($this->getMessage("l.queried", $this->queries[strtolower($sender->getName())]->to));
return true;
}
if (!($to = $this->getServer()->getPlayer($args[0]))) {
$sender->sendMessage($this->getMessage("l.offline"));
return true;
}
$query = new Query();
$query->time = time();
$query->from = $sender->getName();
$query->to = $to->getName();
$this->queries[strtolower($sender->getName())] = $query;
foreach ($this->getServer()->getLevels() as $Level) {
foreach ($Level->getPlayers() as $Player) {
if ($Player->getId() != $sender->getId() && $Player->getId() != $to->getId()) {
$Player->sendMessage($this->getMessage("l.query-all", $sender->getName(), $to->getName()));
}
}
}
$sender->sendMessage($this->getMessage("l.you-query", $to->getName()));
$to->sendMessage($this->getMessage("l.query", $sender->getName()));
$to->sendMessage($this->getMessage("l.query-yes", $sender->getName()));
$to->sendMessage($this->getMessage("l.query-no"));
return true;
}