Код:
public PayDay()
{
new string[128];
new account,interest;
//foreach(Player, i)
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
if(MoneyMessage[i] == 1 && PlayerInfo[i][pJailed] == 0)
{
SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
SetPlayerInterior(i, 0);
SetPlayerPos(i, 264.6288, 77.5742, 1001.0391);
ResetPlayerWeapons(i);
TogglePlayerControllable(i, 1);
PlayerInfo[i][pWantedLevel] = 0;
PlayerInfo[i][pJailed] = 1;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "* You are jailed for %d seconds, Bail: Unavailable.", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
new sendername[MAX_PLAYER_NAME];
new tmpintrate = 1; //interest rate
if(PlayerInfo[i][pDonateRank] == 1){ tmpintrate = 3; }
GetPlayerName(i, sendername, sizeof(sendername));
account = PlayerInfo[i][pAccount]; //bank account amount
if(PlayerInfo[i][pPayDay] >= 0)
{
new checks = PlayerInfo[i][pPayCheck]; //paycheck amount
new incometax = PlayerInfo[i][pPayCheck] / 100 * Tax; //income tax amount
PlayerInfo[i][pCash] = PlayerInfo[i][pCash]+checks-incometax; //give money
GivePlayerMoney(i, checks-incometax); //give money
//TAX MONEY
TaxValue = TaxValue+incometax;
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate); //bank interest
PlayerInfo[i][pAccount] = account+interest; //add interest money to bank
//EXP
PlayerInfo[i][pExp]++; //level
SendClientMessage(i, COLOR_WHITE, "|___ BANK STATEMENT ___|");
format(string, sizeof(string), " Paycheck: $%d", checks);
SendClientMessage(i, COLOR_GRAD1, string);
format(string, sizeof(string), " Income Tax: -$%d", incometax);
SendClientMessage(i, COLOR_GRAD1, string);
format(string, sizeof(string), " Balance: $%d", account);
SendClientMessage(i, COLOR_GRAD1, string);
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), " Interest Gained $%d", interest);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GRAD4, "|------------------------------------------|");
format(string, sizeof(string), " New Balance: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
GameTextForPlayer(i, string, 5000, 1);
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
}
else
{
SendClientMessage(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a Paycheck.");
}
}
}
}
return 1;
}
Hey guys.
This is the paycheck system which I found on a gamemode online, it looks slightly like the NGRP one to me but what do I know. Anyways, when we reach the point and it's supposed to give a paycheck it bugs like hell, it doesn't give more than around 20 dollars and and it never adds anything to your pocket money (even though it says that you receive a paycheck)
Anyone can tell what I should do in order to make it actually give the right amount of money / even give the money instead of adding his interest to the bank only (20 dollars.)
As you can see it says I should have received 7k but I still have 5000 and instead it added slightly abit of money into my bank account (interest)
in GF script you have to add the money to the enum: PlayerInfo[playerid][pCash] += cash
Doesn't seem to work. Still simply adds 20 bucks to the bank account and leaves the pocket money at 500, I don't receive the actual paycheck.