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


PHP Shadowrun4::getPlayerByPID方法代码示例

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


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

示例1: getOnlineMembers

 /**
  * Get all online members for a clan.
  * @param int $cid
  * @return array
  */
 public static function getOnlineMembers($cid)
 {
     $back = array();
     $cid = (int) $cid;
     foreach (self::table(__CLASS__)->selectColumn('sr4cm_pid', "sr4cm_cid={$cid}") as $playerid) {
         if (false !== ($player = Shadowrun4::getPlayerByPID($playerid))) {
             $back[] = $player;
         }
     }
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:16,代码来源:SR_ClanMembers.php

示例2: getWBTarget

 private static function getWBTarget(SR_Player $player)
 {
     $pid = $player->getID();
     if (!isset(Shadowcmd_whisper::$WHISPER[$pid])) {
         return -1;
     }
     $data = Shadowcmd_whisper::$WHISPER[$pid];
     if (count($data) === 1) {
         return Shadowrun4::getPlayerByPID(key($data));
     }
     return -2;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:whisper_back.php

示例3: getRequest

 /**
  * Get the player for a join request.
  * @param SR_Player $leader
  * @param SR_Clan $clan
  * @param string $pname
  * @return SR_Player
  */
 public static function getRequest(SR_Player $leader, SR_Clan $clan, $pname)
 {
     $ename = GDO::escape($pname);
     if (false === ($pid = self::table(__CLASS__)->selectVar('sr4cr_pid', "sr4cr_pname='{$ename}'"))) {
         return false;
     }
     if (false === ($player = Shadowrun4::getPlayerByPID($pid))) {
         if (false === ($player = SR_Player::getByID($pid))) {
             return false;
         }
     }
     return $player;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:20,代码来源:SR_ClanRequests.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, 'gmstats'));
         return false;
     }
     if (false !== ($npc = Shadowrun4::getPlayerByShortName($args[0]))) {
     } elseif ($npc === -1) {
         $bot->reply('The playername is ambigious.');
         return false;
     } elseif (false !== ($npc = Shadowrun4::getPlayerByPID($args[0]))) {
     } else {
         $bot->reply('The player ' . $args[0] . ' is not in memory.');
         return false;
     }
     self::reply($player, Shadowfunc::getStatus($npc, '5301'));
     self::reply($player, Shadowfunc::getEquipment($npc, '5303'));
     self::reply($player, Shadowfunc::getAttributes($npc, '5304'));
     self::reply($player, Shadowfunc::getSkills($npc, '5305'));
     //		$bot->reply(sprintf('Party: %s.', Shadowfunc::getPartyStatus($npc)));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:gms.php

示例5: computeDistances

 /**
  * Compute the distances to an explosion.
  * Imagaine the game like this
  * A
  *  B   E
  *       F
  *    CD
  * ---0m---
  * @param SR_Player $target
  * @param unknown_type $radius
  * @param unknown_type $atk
  * @param unknown_type $atk_delta
  */
 public static function computeDistances(SR_Player $target, $inaccuracy = 3)
 {
     $party = $target->getParty();
     $members = $party->getMembers();
     $coords = array();
     foreach ($members as $m) {
         $m instanceof SR_Player;
         $coords[$m->getID()] = array($m->getX(), $m->getY());
     }
     # Point of impact.
     $g_x = $coords[$target->getID()][0] + Shadowfunc::diceFloat(-$inaccuracy, +$inaccuracy);
     $g_y = $coords[$target->getID()][1] + Shadowfunc::diceFloat(-$inaccuracy, +$inaccuracy);
     // 		echo sprintf("Grenade has coords %.02f / %.02f\n", $g_x, $g_y);
     $back = array();
     foreach ($coords as $uid => $data) {
         list($p_x, $p_y) = $data;
         $d = Shadowfunc::calcDistanceB($g_x, $g_y, $p_x, $p_y);
         $p = Shadowrun4::getPlayerByPID($uid);
         $back[] = array($uid, $d);
         // 			echo sprintf("%s has coords %.02f / %.02f (distance: %.02f)\n", $p->getName(), $p_x, $p_y, $d);
     }
     return $back;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:36,代码来源:SR_Grenade.php

示例6: getRemotePlayer

 public function getRemotePlayer()
 {
     return $this->remote_pid === 0 ? false : Shadowrun4::getPlayerByPID($this->remote_pid);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:SR_Player.php

示例7: getOwner

 public function getOwner()
 {
     return Shadowrun4::getPlayerByPID($this->getOwnerID());
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:SR_Item.php

示例8: getLeader

 /**
  * Get the leader of this clan.
  * @return SR_Player
  */
 public function getLeader()
 {
     $lead_id = $this->getLeaderID();
     if (false === ($leader = Shadowrun4::getPlayerByPID($lead_id))) {
         if (false === ($leader = SR_Player::getByID($lead_id))) {
             return false;
         }
     }
     return $leader;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:14,代码来源:SR_Clan.php

示例9: initMembers

 public function initMembers()
 {
     $dist = explode(',', $this->getVar('sr4pa_distance'));
     foreach (explode(',', $this->getVar('sr4pa_members')) as $i => $playerid) {
         if (false !== ($player = Shadowrun4::getPlayerByPID($playerid))) {
             $this->addUser($player, false);
             $this->distance[$player->getID()] = $dist[$i];
         }
     }
     $this->recomputeEnums();
     if (false === $this->updateMembers()) {
         return false;
     }
     $this->setupMaxDist();
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:16,代码来源:SR_Party.php


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