本文整理汇总了PHP中pocketmine\event\player\PlayerQuitEvent::getPlayer方法的典型用法代码示例。如果您正苦于以下问题:PHP PlayerQuitEvent::getPlayer方法的具体用法?PHP PlayerQuitEvent::getPlayer怎么用?PHP PlayerQuitEvent::getPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\event\player\PlayerQuitEvent
的用法示例。
在下文中一共展示了PlayerQuitEvent::getPlayer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onPlayerQuit
public function onPlayerQuit(PlayerQuitEvent $event)
{
$player = $event->getPlayer();
if ($player instanceof Player) {
$this->plugin->petOwnerDeregister($event->getPlayer());
}
}
示例2: onPlayerQuit
/**
* @param PlayerQuitEvent $event
* @priority MONITOR
*/
public function onPlayerQuit(PlayerQuitEvent $event)
{
if ($this->plugin->isSkinStored($event->getPlayer())) {
$this->plugin->removeSkinData($event->getPlayer());
}
$this->plugin->clearTouchMode($event->getPlayer());
}
示例3: playerQuit
public function playerQuit(PlayerQuitEvent $event)
{
$player = $event->getPlayer()->getDisplayName();
$var = $this->plr->get($player);
$var["foodExaustionLevel"] = $this->foodExhaustion[$player];
$this->plr->set($player, array_merge($var));
$this->plr->save();
$this->foodExhaustion[$event->getPlayer()->getDisplayName()] = false;
}
示例4: onQuit
/**
*
* @param PlayerQuitEvent $event
*/
public function onQuit(PlayerQuitEvent $event)
{
$this->plugin->log("GameLevelListener: " . $event->getEventName() . " player: " . $event->getPlayer()->getName());
//should only notify team $quitMessage
//$event->setQuitMessage("[HG]".$event->getPlayer()->getName()." left the game");
if ($event->getPlayer() instanceof Player) {
$player = $event->getPlayer();
$this->plugin->gameLevelManager->handlePlayerLeaveTheGame($player);
}
}
示例5: onQuitEvent
public function onQuitEvent(PlayerQuitEvent $event)
{
$config = $this->getConfig();
foreach ($this->getServer()->getOnlinePlayers() as $players) {
$playerName = $event->getPlayer()->getName();
$msg2 = $config->get("Announce-Quit");
$msg2 = str_replace("{PLAYER}", $playerName, $msg2);
$p = $event->getPlayer();
$players->sendTip($msg2);
}
}
示例6: onQuit
public function onQuit(PlayerQuitEvent $event)
{
foreach ($this->tntRun->arenas as $arena) {
if ($arena->getPlayerManager()->isInArena($event->getPlayer())) {
if ($arena->getPlayerManager()->isPlaying($event->getPlayer())) {
$arena->getPlayerHandler()->leavePlayer($event->getPlayer());
} else {
$arena->getPlayerHandler()->leaveSpectator($event->getPlayer());
}
return;
}
}
}
示例7: onPlayerQuit
/**
* Handle player quit events. Restore player's inventory before resetting
* state.
*
* @param PlayerQuitEvent $ev - Quit event
*/
public function onPlayerQuit(PlayerQuitEvent $ev)
{
echo __METHOD__ . "," . __LINE__ . "\n";
//##DEBUG
$n = MPMU::iName($ev->getPlayer());
$xx = $this->getState(self::tag, $ev->getPlayer(), null);
if ($xx !== null) {
$this->restoreInv($ev->getPlayer());
}
parent::onPlayerQuit($ev);
echo __METHOD__ . "," . __LINE__ . "\n";
//##DEBUG
}
示例8: onQuit
public function onQuit(PlayerQuitEvent $event)
{
// 숙주가 나가는 것을 캐치후 새 숙주를 선정
if (isset($this->infectionData["hostzombie"])) {
if ($this->infectionData["hostzombie"] == strtolower($event->getPlayer()->getName())) {
$this->infectedHostSelect();
}
}
// TODO 좀비또는 생존자일경우 기록을 제거
if (isset($this->skin["users"][strtolower($event->getPlayer()->getName())])) {
$event->getPlayer()->setSkin($this->skin["users"][strtolower($event->getPlayer()->getName())]);
unset($this->skin["users"][strtolower($event->getPlayer()->getName())]);
}
}
示例9: onQuit
public function onQuit(PlayerQuitEvent $event)
{
$this->clearjoin = $this->getConfig()->get("Clear on Quit");
if ($this->clearjoin == true) {
$event->getPlayer()->getInventory()->setContents(array(Item::get(0, 0, 0)));
}
}
示例10: onPlayerQuitEvent
public function onPlayerQuitEvent(PlayerQuitEvent $e)
{
$pl = MPMU::iName($e->getPlayer());
if (isset($this->state[$pl])) {
unset($this->state[$pl]);
}
}
示例11: onQuit
/**
*
* @param PlayerQuitEvent $event
*/
public function onQuit(PlayerQuitEvent $event)
{
if ($event->getPlayer() instanceof Player) {
$player = $event->getPlayer();
unset($this->plugin->getStatueManager()->npcsSpawns[$event->getPlayer()->getName()]);
}
}
示例12: onQuit
public function onQuit(PlayerQuitEvent $ev)
{
$n = trim(strtolower($ev->getPlayer()->getName()));
if (isset($this->players[$n])) {
unset($this->players[$n]);
}
}
示例13: QuitEvent
public function QuitEvent(PlayerQuitEvent $ev)
{
$player = $ev->getPlayer();
if ($player->isop()) {
$ev->setQuitMessage("GM [" . $player->getName() . "] 님께서 SAO 데이테베이솔부터 로그아웃 하셨습니다 ");
}
}
示例14: onQuit
public function onQuit(PlayerQuitEvent $event)
{
$player = $event->getPlayer();
if (isset($this->tictock[$player->getName()])) {
unset($this->tictock[$player->getName()]);
}
}
示例15: onQuit
public function onQuit(PlayerQuitEvent $event)
{
$player = $event->getPlayer();
if ($this->plugin->hasFlyingSession($player)) {
$this->plugin->removeFlyingSession($player);
}
}