Well the problem is that every hour it gives $700 + the bonus check and what not but it ALWAYS gives $700 and it should give money according on how long they've been on, can anyone help?
pawn Код:
public PayDay(playerid)
{
new string[128];
new account,interest;
new rent = 0;
if(PlayerInfo[playerid][pCellplan] == 2 && PlayerInfo[playerid][pCellphone] == 1)
{
PlayerInfo[playerid][pCelltime] -= 10;
}
if(PlayerInfo[playerid][pBreakAllow] > 0)
{
PlayerInfo[playerid][pBreakAllow]--;
}
if(GetPVarInt(playerid, "PlayerLogged") == 1)
{
if(PlayerInfo[playerid][pJailTime] == 0)
{
if(PlayerInfo[playerid][pJailed] == 0)
{
account = PlayerInfo[playerid][pAccount];
new key = PlayerInfo[playerid][pHousekey];
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
new tmpintrate;
switch(PlayerInfo[playerid][pDonateRank])
{
case 0:
{
tmpintrate = 1;
}
case 1:
{
tmpintrate = 1;
}
case 2:
{
tmpintrate = 2;
}
case 3:
{
tmpintrate = 3;
}
}
if(PlayerInfo[playerid][pPayDay] >= 0)
{
Tax += TaxValue;
PlayerInfo[playerid][pAccount] -= TaxValue;
new checks;
checks = 700;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
new bonus = PlayerInfo[playerid][pPayCheck] / 10;
checks += bonus;
}
new ebill = 125;
account += checks;
if(PlayerInfo[playerid][pAccount] > 0)
{
PlayerInfo[playerid][pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[playerid][pAccount]/1000)*(tmpintrate);
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pAccount] = account+interest;
SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
SendClientMessage(playerid,COLOR_LIGHTYELLOW5," Paycheck Statement: ");
format(string, 128, "[INFO]: Paycheck: $%d | Tax Money: -$%d", checks, TaxValue);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
format(string, 128, "[INFO]: Int Rate: 0.%d percent | Int Gained $%d",tmpintrate,interest);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
if(PlayerInfo[playerid][pHousekey] != 255 || PlayerInfo[playerid][pPbiskey] != 255)
{
format(string, 128, "[INFO]: Electricity Bill: -$%d | Rent: -$%d", ebill,rent);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
}
else if(PlayerInfo[playerid][pHousekey] == 255 || PlayerInfo[playerid][pPbiskey] == 255)
{
format(string, 128, "[INFO]: Rent: -$%d", rent);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
}
if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pMember] == 14)
{
switch (PlayerInfo[playerid][pRank])
{
case 0:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 1:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 2:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 3:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 4:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $400");
PlayerInfo[playerid][pAccount] += 400;
}
case 5:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 6:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
}
}
else if(PlayerInfo[playerid][pMember] == 6)
{
switch (PlayerInfo[playerid][pRank])
{
case 0:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $200");
PlayerInfo[playerid][pAccount] += 200;
}
case 1:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $200");
PlayerInfo[playerid][pAccount] += 200;
}
case 2:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $200");
PlayerInfo[playerid][pAccount] += 200;
}
case 3:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $350");
PlayerInfo[playerid][pAccount] += 350;
}
case 4:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $375");
PlayerInfo[playerid][pAccount] += 375;
}
case 5:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $400");
PlayerInfo[playerid][pAccount] += 400;
}
case 6:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $425");
PlayerInfo[playerid][pAccount] += 425;
}
case 7:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $450");
PlayerInfo[playerid][pAccount] += 450;
}
case 8:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $475");
PlayerInfo[playerid][pAccount] += 475;
}
case 9:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 10:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 11:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 12:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 13:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 14:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 15:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 16:
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, "[INFO]: Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
}
}
if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS)
{
new carkey = PlayerInfo[playerid][pCarkey];
if(CarInfo[carkey][cInsur] == 1)
{
new amount = VehiclePrice(carkey);
format(string, 128, "[INFO]: Insurance Vehicle 1: -$%d", amount);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
PlayerInfo[playerid][pAccount] -= amount;
}
}
if(PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS)
{
new carkey2 = PlayerInfo[playerid][pCarkey2];
if(CarInfo[carkey2][cInsur] == 1)
{
new amount = VehiclePrice(carkey2);
format(string, 128, "[INFO]: Insurance Vehicle 2: -$%d", amount);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
PlayerInfo[playerid][pAccount] -= amount;
}
}
if(PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS)
{
new carkey3 = PlayerInfo[playerid][pCarkey3];
if(CarInfo[carkey3][cInsur] == 1)
{
new amount = VehiclePrice(carkey3);
format(string, 128, "[INFO]: Insurance Vehicle 3: -$%d", amount);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
PlayerInfo[playerid][pAccount] -= amount;
}
}
format(string, 128, "[INFO]: Old Balance: $%d | New Balance: $%d", account - checks, PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
SendClientMessage(playerid,COLOR_YELLOW5,"____________________________________________________");
format(string, 128, "~g~PayDay~n~~w~Check paid into your account");
GameTextForPlayer(playerid, string, 5000, 1);
rent = 0;
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pConnectTime] += 1;
if((4+(PlayerInfo[playerid][pLevel]*8)) == PlayerInfo[playerid][pConnectTime])
{
PlayerInfo[playerid][pConnectTime] += 1;
}
new LevScore;
LevScore = PlayerInfo[playerid][pConnectTime];
SetPlayerScore(playerid,LevScore);
if(ConnectUpgrade(PlayerInfo[playerid][pConnectTime]))
{
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You haven't played long enough to obtain a PayDay.");
}
}
}
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hBreakTime] > 0)
{
HouseInfo[h][hBreakTime]--;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
return 1;
}
Are you testing this on someone whos donation rank is above 0? the bonus is only getting added if your pDonaton is above 0
The bonus is for cops depending on their rank but that's not the problem..
but instead of "700" it should change depending on how many minutes you played that hour.
Oh i see..
Take a look at Godfather script or something... they show you in there... Basicly you just have a timer every 2 seconds (for example) which adds "x" ammount of dollars to your paycheck..
Yeah I'd understand that, but I need it to be based on how much time the player was on for in that hour.