18.03.2011, 01:34
Problem with this - it gives you roughly 1 billion per payday.. I've NO idea how, and the only place it shows that is in the Closing Balance.
Any help is greatly appreciated.
Any help is greatly appreciated.
pawn Код:
public Payday(playerid)
{
if(PlayerInfo[playerid][pPaydayTime] >= 60 && gPlayerLogged[playerid] == 1)
{
new job[15];
strmid(job, GetJobNameFromID(PlayerInfo[playerid][pJob]), 0, strlen(GetJobNameFromID(PlayerInfo[playerid][pJob])), 255);
PlayerInfo[playerid][pTotalPlay] ++;
if(PlayerInfo[playerid][pJobContract] > 0) PlayerInfo[playerid][pJobContract]--;
new Float:interest = PlayerInfo[playerid][pBank] * 0.01;
new house = IsPlayerRentingHouse(playerid);
new faction = PlayerInfo[playerid][pFaction];
new rank = PlayerInfo[playerid][pRank];
if(PlayerInfo[playerid][pPayday] > 1500 && (PlayerInfo[playerid][pJob] == JOB_TRASH || PlayerInfo[playerid][pJob] == JOB_SWEEPER)) PlayerInfo[playerid][pPayday] = 1500;
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}|____________________{FFFFFF}Bank Statement{FF0000}____________________|");
SendFormattedMessage(playerid, COLOR_WHITE, "Opening Balance: {00DC1D}$%d", PlayerInfo[playerid][pBank]);
PlayerInfo[playerid][pBank] += PlayerInfo[playerid][pPayday];
PlayerInfo[playerid][pBank] += interest;
SendFormattedMessage(playerid, COLOR_WHITE, "Job: %s | Job Pay: +{00DC1D}$%d", job, PlayerInfo[playerid][pPayday]);
if(PlayerInfo[playerid][pFaction] > 0) {
PlayerInfo[playerid][pBank] += RankInfo[faction][rank-1][rWage];
SendFormattedMessage(playerid, COLOR_WHITE, "Faction: %s | Wage Pay: +{00DC1D}$%d", GetFactionNameFromID(faction), RankInfo[faction][rank-1][rWage]); // FACTION WAGE
}
SendFormattedMessage(playerid, COLOR_WHITE, "Interest: +{00DC1D}$%.0f", interest)
;
if(house != 0) {
if((PlayerInfo[playerid][pBank] - HouseInfo[house][hRentPrice]) > 0) {
SendFormattedMessage(playerid, COLOR_WHITE, "Rent: -{00DC1D}$%d", HouseInfo[house][hRentPrice]);
PlayerInfo[playerid][pBank] -= HouseInfo[house][hRentPrice];
if(PlayerInfo[playerid][pRentTime] > 0) PlayerInfo[playerid][pRentTime] --;
}
else {
SendClientMessage(playerid, COLOR_WHITE, "Rent: Unable to pay. You've been evicted.");
EvictPlayer(playerid);
}
}
PlayerInfo[playerid][pTotalPay] += PlayerInfo[playerid][pPayday];
PlayerInfo[playerid][pPayday] = 0;
PlayerInfo[playerid][pPaydayTime] = 0;
SendFormattedMessage(playerid, COLOR_WHITE, "Closing Balance: {00DC1D}$%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}____________________________________________________________");
printf("Payday function called for playerid %d", playerid);
}
else if(PlayerInfo[playerid][pPaydayTime] < 60 && gPlayerLogged[playerid] == 1)
{
PlayerInfo[playerid][pPaydayTime] ++;
}
return 1;
}