本文整理汇总了PHP中Globals::getStartingCredits方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::getStartingCredits方法的具体用法?PHP Globals::getStartingCredits怎么用?PHP Globals::getStartingCredits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Globals
的用法示例。
在下文中一共展示了Globals::getStartingCredits方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MAX
if (SmrSession::$account_id == ACCOUNT_ID_NHL) {
$alliance_id = 302;
} else {
$alliance_id = 0;
}
$db->lockTable('player');
// get last registered player id in that game and increase by one.
$db->query('SELECT MAX(player_id) FROM player WHERE game_id = ' . $db->escapeNumber($gameID));
if ($db->nextRecord()) {
$player_id = $db->getInt('MAX(player_id)') + 1;
} else {
$player_id = 1;
}
// insert into player table.
$db->query('INSERT INTO player (account_id, game_id, player_id, player_name, race_id, ship_type_id, credits, alliance_id, sector_id, last_turn_update, last_cpl_action, last_active, newbie_turns)
VALUES(' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber($player_id) . ', ' . $db->escape_string($player_name, true) . ', ' . $db->escapeNumber($race_id) . ', ' . $db->escapeNumber($ship_id) . ', ' . $db->escapeNumber(Globals::getStartingCredits($gameID)) . ', ' . $db->escapeNumber($alliance_id) . ', ' . $db->escapeNumber($home_sector_id) . ', ' . $db->escapeNumber($last_turn_update) . ', ' . $db->escapeNumber(TIME) . ', ' . $db->escapeNumber(TIME) . ',' . $db->escapeNumber($startingNewbieTurns) . ')');
$db->unlock();
// give the player shields
$db->query('INSERT INTO ship_has_hardware (account_id, game_id, hardware_type_id, amount, old_amount)
VALUES(' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber($gameID) . ', 1, ' . $db->escapeNumber($amount_shields) . ', ' . $db->escapeNumber($amount_shields) . ')');
// give the player armour
$db->query('INSERT INTO ship_has_hardware (account_id, game_id, hardware_type_id, amount, old_amount)
VALUES(' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber($gameID) . ', 2, ' . $db->escapeNumber($amount_armour) . ', ' . $db->escapeNumber($amount_armour) . ')');
// give the player cargo hold
$db->query('INSERT INTO ship_has_hardware (account_id, game_id, hardware_type_id, amount, old_amount)
VALUES(' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber($gameID) . ', 3, 40, 40)');
// give the player weapons
$db->query('INSERT INTO ship_has_weapon (account_id, game_id, order_id, weapon_type_id)
VALUES(' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber($gameID) . ', 0, 46)');
// insert the huge amount of sectors into the database :)
$db->query('SELECT MIN(sector_id), MAX(sector_id)
示例2: number_format
?>
</td>
</tr>
<tr>
<td align="right">Stats Ignored</td>
<td> </td>
<td align="left"><?php
echo Globals::getGameIgnoreStats($StatsGameID) ? 'Yes' : 'No';
?>
</td>
</tr>
<tr>
<td align="right">Starting Credits</td>
<td> </td>
<td align="left"><?php
echo number_format(Globals::getStartingCredits($StatsGameID));
?>
</td>
</tr>
</table>
</td>
<td valign="top" align="center">
<table class="nobord">
<tr>
<td align="right">Total Players</td>
<td> </td><td align="left"><?php
echo number_format($TotalPlayers);
?>
</td>
</tr>
<tr>