本文整理汇总了PHP中Player::getLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP Player::getLevel方法的具体用法?PHP Player::getLevel怎么用?PHP Player::getLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player::getLevel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onActivate
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz)
{
if (!$ev->isCancelled()) {
$player->getLevel()->setBlock($target, new RedstoneWire(), \true, \true);
if ($player->isSurvival()) {
$player->getInventory()->setItemInHand($ev->getItem(), $player);
}
return \true;
} else {
$player->getInventory()->sendContents($player);
}
}
示例2: htmlspecialchars
$guild_errors[] = 'Guild <b>' . htmlspecialchars($new_guild_name) . '</b> already exist. Select other name.';
}
}
if (empty($guild_errors)) {
$bad_char = TRUE;
foreach ($array_of_player_nig as $nick_from_list) {
if ($nick_from_list == $player->getName()) {
$bad_char = FALSE;
}
}
if ($bad_char) {
$guild_errors[] = 'Character <b>' . htmlspecialchars($name) . '</b> isn\'t on your account or is already in guild.';
}
}
if (empty($guild_errors)) {
if ($player->getLevel() < $config['site']['guild_need_level']) {
$guild_errors[] = 'Character <b>' . htmlspecialchars($name) . '</b> has too low level. To create guild you need character with level <b>' . $config['site']['guild_need_level'] . '</b>.';
}
if ($config['site']['guild_need_pacc'] && !$account_logged->isPremium()) {
$guild_errors[] = 'Character <b>' . htmlspecialchars($name) . '</b> is on FREE account. To create guild you need PREMIUM account.';
}
}
}
if (!empty($guild_errors)) {
$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url(' . $layout_name . '/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
foreach ($guild_errors as $guild_error) {
$main_content .= '<li>' . $guild_error . '</li>';
}
$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> </div></div><br>';
unset($todo);
}
示例3: addPlayer
public function addPlayer(Player $player)
{
if (count($this->players) >= $this->maxPlayers) {
if ($player->hasPermission("sg.perks.join-full")) {
// Players who have the correct permissions can join even when arenas are full.
$m = count($this->players);
$kick = array_keys($this->players)[rand(0, $m - 1)];
$this->kickPlayer($this->players[$kick]["obj"], "Making space for " . $player->getName());
} else {
return false;
}
}
$this->players[$player->getName()]["obj"] = $player;
$this->players[$player->getName()]["pos"] = new Vector3($player->getX(), $player->getY(), $player->getZ());
$this->players[$player->getName()]["level"] = $player->getLevel();
$this->players[$player->getName()]["inventory"] = $player->getInventory();
return true;
}
示例4: htmlspecialchars
$main_content .= '<span style="color:red">[BANNED]</span>';
}
if ($player->isNamelocked()) {
$main_content .= '<span style="color:red">[NAMELOCKED]</span>';
}
$main_content .= '<br /><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player->getLookType() . '&addons=' . $player->getLookAddons() . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet() . '" alt="" /></td></tr>';
if (in_array($player->getGroup(), $config['site']['groups_support'])) {
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Group:</td><td>' . htmlspecialchars(Website::getGroupName($player->getGroup())) . '</td></tr>';
}
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Sex:</td><td>' . htmlspecialchars($player->getSex() == 0 ? 'female' : 'male') . '</td></tr>';
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Profession:</td><td>' . htmlspecialchars(Website::getVocationName($player->getVocation())) . '</td></tr>';
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Level:</td><td>' . htmlspecialchars($player->getLevel()) . '</td></tr>';
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>World:</td><td>' . htmlspecialchars($config['site']['worlds'][$player->getWorldID()]) . '</td></tr>';
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Residence:</td><td>' . htmlspecialchars($towns_list[0][$player->getTownID()]) . '</td></tr>';
$rank_of_player = $player->getRank();
if (!empty($rank_of_player)) {
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Guild Membership:</td><td>' . htmlspecialchars($rank_of_player->getName()) . ' of the <a href="?subtopic=guilds&action=show&guild=' . $rank_of_player->getGuild()->getID() . '">' . htmlspecialchars($rank_of_player->getGuild()->getName()) . '</a></td></tr>';
}
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Balance:</td><td>' . htmlspecialchars($player->getBalance()) . ' gold coins</td></tr>';
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
$main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Last login:</td><td>' . ($player->getLastLogin() > 0 ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.') . '</td></tr>';
if ($player->getCreateDate() > 0) {
$bgcolor = $number_of_rows++ % 2 == 1 ? $config['site']['darkborder'] : $config['site']['lightborder'];
示例5: Player
<?php
if (!defined('INITIALIZED')) {
exit;
}
$player = new Player();
$player->find($_GET['name']);
if ($player->isLoaded()) {
if (!file_exists('cache/signatures/' . $player->getID()) || filemtime('cache/signatures/' . $player->getID()) === false || filemtime('cache/signatures/' . $player->getID()) + 30 < time()) {
$image = imagecreatefrompng('./images/signatures/signature.png');
$color = imagecolorallocate($image, 255, 255, 255);
imagettftext($image, 12, 0, 20, 32, $color, './images/signatures/font.ttf', 'Name:');
imagettftext($image, 12, 0, 70, 32, $color, './images/signatures/font.ttf', $player->getName());
imagettftext($image, 12, 0, 20, 52, $color, './images/signatures/font.ttf', 'Level:');
imagettftext($image, 12, 0, 70, 52, $color, './images/signatures/font.ttf', $player->getLevel() . ' ' . Website::getVocationName($player->getVocation()));
if ($player->getRank()) {
imagettftext($image, 12, 0, 20, 75, $color, './images/signatures/font.ttf', 'Guild:');
imagettftext($image, 12, 0, 70, 75, $color, './images/signatures/font.ttf', $player->getRank()->getName() . ' of the ' . $player->getRank()->getGuild()->getName());
}
imagettftext($image, 12, 0, 20, 95, $color, './images/signatures/font.ttf', 'Last Login:');
imagettftext($image, 12, 0, 100, 95, $color, './images/signatures/font.ttf', $player->getLastLogin() > 0 ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.');
imagepng($image, 'cache/signatures/' . $player->getID());
imagedestroy($image);
}
header("Content-type: image/png");
echo file_get_contents('cache/signatures/' . $player->getID());
}
exit;