Paycheck Problem HELP
#1

I have problem the paycheck system always show me this''You haven't played long enough to obtain a paycheck''


Код:
PlayerInfo[i][pExp]++;
					PlayerInfo[i][pAccount] = account+interest;
					SendClientMessageEx(i, COLOR_WHITE, "________ BANK STATEMENT ________");
					format(string, sizeof(string), "  Paycheck: $%d  |  Tax Money: -$%d (%d percent)", checks, Taxable, TaxValue);
					SendClientMessageEx(i, COLOR_GRAD1, string);

					if(PlayerInfo[i][pDonateRank] == 0)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent (50k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}
					if(PlayerInfo[i][pTaxiLicense] == 1)
					{
						format(string, sizeof(string), "  Taxi licensing fee (5 percent): -$%d",faretax);
						SendClientMessageEx(i, COLOR_GRAD2, string);
					}
					if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13)
					{
					    if(Tax <= 0)
						{
							SendClientMessageEx(i,COLOR_RED,"The government is in debt; no money is available for pay.");
						}
						else
						{
							Tax -= FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
							format(string,sizeof(string),"  Government pay: $%d", FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]]);
					    	SendClientMessageEx(i, COLOR_GRAD2, string);
						}
					}
					format(string, sizeof(string), "  Interest gained: $%d", interest);
					SendClientMessageEx(i, COLOR_GRAD3, string);
					SendClientMessageEx(i, COLOR_GRAD4, "______________________________________");
					format(string, sizeof(string), "  New balance: $%d  |  Rent paid: -$%d", PlayerInfo[i][pAccount],rent);
					SendClientMessageEx(i, COLOR_GRAD5, string);

					new paycheck = checks - Taxable - faretax;
					if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13 && Tax >= 0)
					{
						new facmemberpay = FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
						GivePlayerCash(i, facmemberpay);
					}
					GivePlayerCash(i, paycheck);

					GameTextForPlayer(i, "~y~PayDay~n~~w~Paycheck", 5000, 1);
					SendAudioToPlayer(i, 1184, 100, 0);
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime] += 1;
					if(PlayerInfo[i][pConnectTime] == 2) SendClientMessageEx(i, COLOR_LIGHTRED, "You're now allowed to use firearms!");
					if(PlayerInfo[i][pDonateRank] > 0)
					{
						PlayerInfo[i][pPayDayHad] += 1;
						if(PlayerInfo[i][pPayDayHad] >= 5)
						{
							PlayerInfo[i][pExp]++;
							PlayerInfo[i][pPayDayHad] = 0;
						}
					}
					if(PlayerInfo[i][pWRestricted] > 0)
					{
					    PlayerInfo[i][pWRestricted]--;
						if(PlayerInfo[i][pWRestricted] == 0) SendClientMessageEx(i, COLOR_LIGHTRED, "Your weapons are no longer restricted!");
					}

				}
				else
				{
					SendClientMessageEx(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a paycheck.");
				}
			}
Reply
#2

You didn't show us all of the script. There is an upper script missing.
Reply
#3

Check now
Код:
public PayDay()
{
	new string[128];
	new account,interest;
	new rent = 0;
 	foreach(Player, i)
	{
			if(PlayerInfo[i][pLevel] > 0)
			{
				if(MoneyMessage[i]==1)
				{
				    if( PlayerInfo[i][pJailed] < 1 && !IsACop(i))
				    {
				        format(string,sizeof(string),"You're failing to pay your debt of $%d - now the police are on the look out for you.",GetPlayerCash(i));
						SendClientMessageEx(i, COLOR_LIGHTRED, string);
						if(PlayerInfo[i][pWantedLevel] < 6) PlayerInfo[i][pWantedLevel] += 1;
						PlayerInfo[i][pCrimes] += 1;
						SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]);
					}
				}
				account = PlayerInfo[i][pAccount];
				if(PlayerInfo[i][pRenting] != INVALID_HOUSE_ID)
				{
					if(HouseInfo[PlayerInfo[i][pRenting]][hRentFee] > PlayerInfo[i][pAccount])
					{
						PlayerInfo[i][pRenting] = INVALID_HOUSE_ID;
						SendClientMessageEx(i, COLOR_WHITE, "You have been evicted.");
					}
					else {
						HouseInfo[PlayerInfo[i][pRenting]][hSafeMoney] += HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
						PlayerInfo[i][pAccount] -= HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
					}
				}
				new tmpintrate, faretax;
				tmpintrate = 1;
				
				if(PlayerInfo[i][pPayDay] >= 5)
				{
                    if(GetPVarInt(i, "AdvisorDuty") == 1)
					{
	    				PlayerInfo[i][pDutyHours]++;
					}
					if(PlayerInfo[i][pDonateRank] > 0)
					{
						new bonus = PlayerInfo[i][pPayCheck] / 2;
						PlayerInfo[i][pPayCheck] += bonus;
					}
					if(SpecTimer == 1)
					{
						AddSpecialToken(i);
					}
					rent = 0;
					faretax = 0;
					new checks = PlayerInfo[i][pPayCheck];
					if(PlayerInfo[i][pTaxiLicense] == 1) faretax = (checks/100)*5;
					new Taxable = (( checks / 100 ) * TaxValue);
					PlayerInfo[i][pAccount] -= Taxable + faretax;
					Tax += Taxable + faretax;

					interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);

					if(PlayerInfo[i][pDonateRank] == 0 && interest > 50000)
					{
						interest = 50000;
					}
					else if(PlayerInfo[i][pDonateRank] == 1 && interest > 100000)
					{
						interest = 100000;
					}
					else if(PlayerInfo[i][pDonateRank] == 2 && interest > 150000)
					{
						interest = 150000;
					}
					else if(PlayerInfo[i][pDonateRank] == 3 && interest > 200000)
					{
						interest = 200000;
					}
					else if(PlayerInfo[i][pDonateRank] >= 4 && interest > 250000)
					{
						interest = 250000;
					}


					PlayerInfo[i][pExp]++;
					PlayerInfo[i][pAccount] = account+interest;
					SendClientMessageEx(i, COLOR_WHITE, "________ BANK STATEMENT ________");
					format(string, sizeof(string), "  Paycheck: $%d  |  Tax Money: -$%d (%d percent)", checks, Taxable, TaxValue);
					SendClientMessageEx(i, COLOR_GRAD1, string);

					if(PlayerInfo[i][pDonateRank] == 0)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent (50k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}
					if(PlayerInfo[i][pTaxiLicense] == 1)
					{
						format(string, sizeof(string), "  Taxi licensing fee (5 percent): -$%d",faretax);
						SendClientMessageEx(i, COLOR_GRAD2, string);
					}
					if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13)
					{
					    if(Tax <= 0)
						{
							SendClientMessageEx(i,COLOR_RED,"The government is in debt; no money is available for pay.");
						}
						else
						{
							Tax -= FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
							format(string,sizeof(string),"  Government pay: $%d", FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]]);
					    	SendClientMessageEx(i, COLOR_GRAD2, string);
						}
					}
					format(string, sizeof(string), "  Interest gained: $%d", interest);
					SendClientMessageEx(i, COLOR_GRAD3, string);
					SendClientMessageEx(i, COLOR_GRAD4, "______________________________________");
					format(string, sizeof(string), "  New balance: $%d  |  Rent paid: -$%d", PlayerInfo[i][pAccount],rent);
					SendClientMessageEx(i, COLOR_GRAD5, string);

					new paycheck = checks - Taxable - faretax;
					if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13 && Tax >= 0)
					{
						new facmemberpay = FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
						GivePlayerCash(i, facmemberpay);
					}
					GivePlayerCash(i, paycheck);

					GameTextForPlayer(i, "~y~PayDay~n~~w~Paycheck", 5000, 1);
					SendAudioToPlayer(i, 1184, 100, 0);
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime] += 1;
					if(PlayerInfo[i][pConnectTime] == 2) SendClientMessageEx(i, COLOR_LIGHTRED, "You're now allowed to use firearms!");
					if(PlayerInfo[i][pDonateRank] > 0)
					{
						PlayerInfo[i][pPayDayHad] += 1;
						if(PlayerInfo[i][pPayDayHad] >= 5)
						{
							PlayerInfo[i][pExp]++;
							PlayerInfo[i][pPayDayHad] = 0;
						}
					}
					if(PlayerInfo[i][pWRestricted] > 0)
					{
					    PlayerInfo[i][pWRestricted]--;
						if(PlayerInfo[i][pWRestricted] == 0) SendClientMessageEx(i, COLOR_LIGHTRED, "Your weapons are no longer restricted!");
					}

				}
				else
				{
					SendClientMessageEx(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a paycheck.");
				}
			}
	}
Reply
#4

I would suggest debuging the code.

pawn Код:
printf("PayDay=%i",PlayerInfo[i][pPayDay]);
if(PlayerInfo[i][pPayDay] >= 5)
{
Reply
#5

Stop using the NGRP script, thanks.
Reply
#6

Quote:
Originally Posted by Unte99
Посмотреть сообщение
I would suggest debuging the code.

pawn Код:
printf("PayDay=%i",PlayerInfo[i][pPayDay]);
if(PlayerInfo[i][pPayDay] >= 5)
{
Where to put this?
Reply
#7

Using Next Generation RolePlay script isn't legal, refrain from using it please.
Reply
#8

I dont know what script is,a friend sended to me and its all edited
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)