09.09.2012, 13:02
hey guys. i've got a problem with my payday. i'm getting 0$ all the time and the tax is 0$ even i set it to 1000 as Mayor. please help.
this is the payday code
this is the payday code
Код:
public PayDay() { new string[1000]; new account,interest; new rent = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pLevel] > 0) { if(MoneyMessage[i]==1) { SendClientMessage(i, COLOR_1RED, "You failed to pay your debt, Jail time."); GameTextForPlayer(i, "~r~Busted!", 2000, 1); SetPlayerInterior(i, 6); PlayerInfo[i][pInt] = 6; SetPlayerPos(i, 264.6288,77.5742,1001.0391); PlayerInfo[i][pJailed] = 1; SetPlayerSkin(i, 62); ResetPlayerWeapons(i); ResetPlayerMoneyEx(i); WantedPoints[i] = 0; PlayerInfo[i][pJailTime] = 240; format(string, sizeof(string), "Esti la inchisoare %d secunde. Bail: Unable", PlayerInfo[i][pJailTime]); SendClientMessage(i, COLOR_WHITE, string); } new money=GetPlayerMoney(i); new playername2[MAX_PLAYER_NAME]; GetPlayerName(i, playername2, sizeof(playername2)); account = PlayerInfo[i][pAcont]; new key = PlayerInfo[i][pPcasakey]; if(key != 255) { rent = HouseInfo[key][hRent]; if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0) { rent = 0; } else if(rent > GetPlayerMoneyEx(i)) { PlayerInfo[i][pPcasakey] = 255; SendClientMessage(i, COLOR_WHITE, "Ai fost Evacuat."); rent = 0; } HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent; } new tmpintrate; if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0) { if(PlayerInfo[i][pDonateRank] > 2) { tmpintrate = intrate+2; } else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel] } else { if(PlayerInfo[i][pDonateRank] > 2) { tmpintrate = 1; } else { tmpintrate = 1; } } if(PlayerInfo[i][pPayDay] >= 5) { Tax += TaxValue;//Should work for every player online PlayerInfo[i][pAcont] -= TaxValue; new checks = PlayerInfo[i][pPayCheck]; if(PlayerInfo[i][pDonateRank] > 2) { GivePlayerMoneyEx(i, 100000); } new ebill = (PlayerInfo[i][pAcont]/10000)*(PlayerInfo[i][pLevel]); ConsumingMoney[i] = 1; GivePlayerMoneyEx(i, checks); if(PlayerInfo[i][pAcont] > 0) { PlayerInfo[i][pAcont] -= ebill; SBizzInfo[4][sbTill] += ebill; } else { ebill = 0; } new h,mi; gettime(h,mi); interest = (PlayerInfo[i][pAcont]/1000)*(tmpintrate); PlayerInfo[i][pExp]++; PlayerPlayMusic(i); PlayerInfo[i][pAcont] = account+interest; new year,month,day,hours,minutes,seconds; getdate(year, month, day), gettime(hours, minutes, seconds); if(PlayerInfo[i][pDonateRank] > 2) { new str[1024]; format(str,1024,""wh"_________|"color_red"STATISTICI BANCA"wh"|_________\n\n"); format(str,1024,"%s"wh"Bani primiti: "color_green"%d$\n",str,checks+15000); format(str,1024,"%s"wh"Taxa bani: "color_green"-%d$\n",str,TaxValue); if(PlayerInfo[i][pPcasakey] != 255 || PlayerInfo[i][pPbizkey] != 255){format(str,1024,"%s"wh"Electicitate Bill: "color_green"-%d$\n",str,ebill);} format(str,1024,"%s"wh"Balanta veche: "color_green"%d$\n",str,money); format(str,1024,"%s"wh"Dobanda: "color_green"0.%d "wh"percent\n",str,tmpintrate); format(str,1024,"%s"wh"Castig "color_green"%d$\n",str , interest); format(str,1024,"%s"wh"Bani cont: "color_green"%d$\n",str , PlayerInfo[i][pAcont]); format(str,1024,"%s"wh"Ora: "color_cyan"%02d:%02d",str,h,mi); format(str,1024,"%s\t\t "color_red"PayDay\n",str); format(str,1024,"%s\t\t\t\t"color_blue"PayCheck",str); ShowPlayerDialog( i, 790, DIALOG_STYLE_MSGBOX, " ", str, "Iesi", "" ); } else { new str[1024]; format(str,1024,""wh"_________|"color_red"STATISTICI BANCA"wh"|_________\n\n"); format(str,1024,"%s"wh"Bani primiti: "color_green"%d$\n",str,checks); format(str,1024,"%s"wh"Taxa bani: "color_green"-%d$\n",str,TaxValue); if(PlayerInfo[i][pPcasakey] != 255 || PlayerInfo[i][pPbizkey] != 255){format(str,1024,"%s"wh"Electicitate Bill: "color_green"-%d$\n",str,ebill);} format(str,1024,"%s"wh"Balanta veche: "color_green"%d$\n",str,money); format(str,1024,"%s"wh"Dobanda: "color_green"0.%d "wh"percent\n",str,tmpintrate); format(str,1024,"%s"wh"Castig "color_green"%d$\n",str , interest); format(str,1024,"%s"wh"Bani cont: "color_green"%d$\n",str , PlayerInfo[i][pAcont]); format(str,1024,"%s"wh"Ora: "color_cyan"%02d:%02d",str,h,mi); format(str,1024,"%s\t\t "color_red"PayDay\n",str); format(str,1024,"%s\t\t\t\t"color_blue"PayCheck",str); ShowPlayerDialog( i, 790, DIALOG_STYLE_MSGBOX, " ", str, "Iesi", "" ); } rent = 0; PlayerInfo[i][pPayDay] = 0; PlayerInfo[i][pPayCheck] = 0; PlayerInfo[i][pConnectTime] += 1; if(PlayerInfo[i][pDonateRank] > 2) { PlayerInfo[i][pPayDayHad] += 1; if(PlayerInfo[i][pPayDayHad] >= 5) { PlayerInfo[i][pExp]++; PlayerInfo[i][pPayDayHad] = 0; } } if(FarmerVar[i] == 0) { FarmerPickup[i][0] = 0; } } else { SendClientMessage(i, COLOR_WHITE, "* You haven't played long enough to obtain a PayDay."); } } } } SaveAccounts(); #if RealEstate == true Checkprop(); #endif return 1; }