19.10.2013, 04:50
Linha:
Cуdigo completo:
O que pode ser?
PHP код:
for (new playerid; playerid < MAX_PLAYERS; playerid++)
PHP код:
forward Bank_IntrestTimer(playerid);
public Bank_IntrestTimer(playerid)
{
// Setup local variables
new IntrestAmount, Msg[128];
// Increase the variable by one
CurrentIntrestTime++;
// And save it to the file
IntrestTime_Save();
// Process intrest for all online player with a bank account if intrest is enabled
if (IntrestEnabled == true)
{
// Loop through all players
for (new playerid; playerid < MAX_PLAYERS; playerid++)
{
// Check if this player is logged in
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
// Check if this player has a bank account (just check if there is money in the bank, it's useless to process the intrest for
// a bank account which doesn't have any money in it, and having BankMoney also means the player has a bank account)
if (APlayerData[playerid][BankMoney] > 0)
{
// Calculate the intrest
IntrestAmount = floatround(floatmul(APlayerData[playerid][BankMoney], BankIntrest), floatround_floor);
// Add intrest to this player's bank account
APlayerData[playerid][BankMoney] = APlayerData[playerid][BankMoney] + IntrestAmount;
// Save the CurrentIntrestTime for this bank account
APlayerData[playerid][LastIntrestTime] = CurrentIntrestTime;
// Save the player's bank account
BankFile_Save(playerid);
// Inform the player that he received intrest on his bank account and how much
format(Msg, 128, "Os juros chegaram! ^^", IntrestAmount);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
}
}
}
}
}