本文整理汇总了PHP中SR_Player::getByLongName方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::getByLongName方法的具体用法?PHP SR_Player::getByLongName怎么用?PHP SR_Player::getByLongName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::getByLongName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: loadPlayerByName
/**
* Load a player by name. Usually this username{serverid}
* @param string $username
*/
public static function loadPlayerByName($username)
{
if (false === ($player = self::getPlayerByName($username))) {
return SR_Player::getByLongName($username);
}
return $player;
}