05.03.2009, 22:13
Hello guys im stuck on this one well here i go.. i have made a fishing license that expires after 5 paydays like a permit but the problem im havin is when it gets to the 6th payday the permit hours start going in minus and keeps going back so when you buy another u have to buy 2 or 3 to top up the munus hours to get back into plus. so my question is any idea how to fix it ??
regards ktr
regards ktr
Код:
pFishLicenseTime,
PlayerInfo[playerid][pFishLicenseTime] = 0;
-----------------------------------------------
if (GetPlayerMoney(playerid) > 500)
{
PlayerInfo[playerid][pFishLicenseTime] += 5;
PlayerInfo[playerid][pFishLic] = 1;
SendClientMessage(playerid, COLOR_GREY, " You have been charged $500 for your purchase.");
SendClientMessage(playerid,COLOR_GREY," Congratulations! You now have a 5 Hour fishing Permit.");
SendClientMessage(playerid, COLOR_GRAD5, "You can check this anytime by typing /licenses");
SafeGivePlayerMoney(playerid,-500);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
TogglePlayerControllable(playerid, 1);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "You don't have enough cash.");
TogglePlayerControllable(playerid, 1);
//---------- this bit in payday--------------
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), " Rent: -$%d", rent);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
PlayerInfo[i][pDonorExtraPay]++;
PlayerInfo[i][pFishLicenseTime] -= 1;
if (PlayerInfo[i][pFishLic] == 1 && PlayerInfo[i][pFishLicenseTime] <= 0)
{
PlayerInfo[i][pFishLic] = 0;
PlayerInfo[i][pFishLicenseTime] = 0;
SendClientMessage(i, COLOR_LIGHTRED, "* Your Fishing License has expired!");
}
if (PlayerInfo[i][pFishingPole] > 0)
{
if ( (PlayerInfo[i][pFishLicenseTime] / 5) == 1)
{
PlayerInfo[i][pFishingPole] = 0;
SendClientMessage(i, COLOR_LIGHTRED, "* Your Fishing Pole has broken!");
}
}
format(var, 32, "FishTime=%d\n",PlayerInfo[playerid][pFishLicenseTime]);fwrite(hFile, var);
if( strcmp( key , "FishTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pFishLicenseTime] = strvalEx( val ); }
-----------------this in licenses---------------------
format(string, sizeof(string), "** Fishing License: %s. (%d Hours Left)", text3, PlayerInfo[playerid][pFishLicenseTime]);

