本文整理匯總了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>