当前位置: 首页>>代码示例>>PHP>>正文


PHP Shadowrun4::getPlayerByName方法代码示例

本文整理汇总了PHP中Shadowrun4::getPlayerByName方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowrun4::getPlayerByName方法的具体用法?PHP Shadowrun4::getPlayerByName怎么用?PHP Shadowrun4::getPlayerByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shadowrun4的用法示例。


在下文中一共展示了Shadowrun4::getPlayerByName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: msg

 public function msg($key, $args = NULL)
 {
     if ($key === '5086') {
         $player = Shadowrun4::getPlayerByName(array_shift($args));
         $this->setChatPartner($player);
         $word = array_shift($args);
         return $this->onNPCWhisper($player, $word, $args);
     }
     if ($key === '') {
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:SR_TalkingNPC.php

示例2: getPlayerInLocation

 /**
  * @param SR_Player $player
  * @param string $name
  * @return SR_Player
  */
 public static function getPlayerInLocation(SR_Player $player, $name)
 {
     if (false === ($back = Shadowrun4::getPlayerByName($name))) {
         return false;
     }
     # Same party
     if ($back->getPartyID() === $player->getPartyID()) {
         return $back;
     }
     if (self::sharesLocation($player, $back)) {
         return $back;
     }
     return false;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:Shadowfunc.php

示例3: onPayOwner

 public function onPayOwner(SR_Player $buyer, $amt)
 {
     $price = $this->getVar('sr4ba_price') * $amt;
     $pname = $this->getVar('sr4ba_pname');
     if (false === ($seller = Shadowrun4::getPlayerByName($pname))) {
         if (false === ($seller = SR_Player::getByLongName($pname))) {
             return false;
         }
     }
     if (false === $seller->giveBankNuyen($price)) {
         return false;
     }
     $iname = $this->getVar('sr4ba_iname');
     $seller->msg('5035', array(Shadowfunc::displayNuyen($price), $amt, $iname, $buyer->getName()));
     // 		$seller->message(sprintf('%s have been booked to your bank account for selling %s %s to %s.', Shadowfunc::displayNuyen($price), $amt, $iname, $buyer->getName()));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:17,代码来源:SR_BazarItem.php

示例4: execute

 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     if (count($args) !== 1) {
         $bot->reply(Shadowhelp::getHelp($player, 'gmload'));
         return false;
     }
     if (false !== ($target = Shadowrun4::getPlayerByName($args[0]))) {
         $bot->reply(sprintf('The player %s is already in memory.', $args[0]));
         return false;
     }
     if (false === ($target = Shadowrun4::loadPlayerByName($args[0]))) {
         $bot->reply(sprintf('The player %s is unknown.', $args[0]));
         return false;
     }
     Shadowrun4::addPlayer($target);
     $bot->reply(sprintf('The player %s has been loaded into memory.', $args[0]));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:gmload.php

示例5: onBan

 protected static function onBan(SR_Player $player, array $args, $bool)
 {
     // 		$bot = Shadowrap::instance($player);
     if (count($args) > 1) {
         self::reply($player, Shadowhelp::getHelp($player, $bool === true ? 'ban' : 'unban'));
         // 			$bot->reply(Shadowhelp::getHelp($player, $bool===true?'ban':'unban'));
         return false;
     }
     $p = $player->getParty();
     if (count($args) === 0) {
         $p->banAll($bool);
         $key = $bool === true ? '5065' : '5066';
         return self::rply($player, $key);
         // 			if ($bool === true)
         // 			{
         // 				$msg = 'Your party does not accept new members anymore.';
         // 			}
         // 			else
         // 			{
         // 				$msg = 'Your party does accept new members again.';
         // 			}
         // 			$bot->reply($msg);
         // 			return true;
     }
     if (false === ($target = Shadowrun4::getPlayerByName($args[0]))) {
         self::rply($player, '1017');
         // 			$bot->reply('This player is unknown or not in memory.');
         return false;
     }
     $args = array($target->getName());
     $key = $bool === true ? '5067' : '5068';
     if ($bool === true) {
         $p->ban($target);
         // 			$bot->reply(sprintf('%s has been banned from the party.', $target->getName()));
     } else {
         $p->unban($target);
         // 			$bot->reply(sprintf('%s may now join your party again.', $target->getName()));
     }
     // 		return true;
     return self::rply($player, $key, $args);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:41,代码来源:ban.php

示例6: getPlayer

 public static function getPlayer($param)
 {
     return Shadowrun4::getPlayerByName($param);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:SR_AIExtension.php

示例7: getHijackTarget

 /**
  * @return SR_Player
  */
 public function getHijackTarget($last = false)
 {
     return Shadowrun4::getPlayerByName($this->getHijackTargetName($last));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:7,代码来源:SR_Party.php


注:本文中的Shadowrun4::getPlayerByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。