- 0
Problema pPlayerHours
-
Similar Content
-
- 3 replies
- 192 views
-
- 1 reply
- 162 views
-
- 1 answer
- 470 views
-
- 6 replies
- 516 views
-
- 4 replies
- 450 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
Raz0r
Problema intalnita (descriere):Nu imi vine ora jucata la payday si nici in baza de date nu se seteaza, dar cand dau cu /set se seteaza in /stats si in baza de date.
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):
public PayDay()
{
foreach(Player, x)
{
new
BankInterest = playerVariables[x][pBankMoney] / 250,
RandPay = (random(495) + 5) * (playerVariables[x][pPlayingHours]/60) + random(5000) + 500,
TotalPay = BankInterest + RandPay;
SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");
SendClientMessage(x, COLOR_WHITE, "Your paycheck has arrived, please visit the bank to withdraw your money.");
playerVariables[x][pBankMoney] += TotalPay;
new taxamount = 5;
if(playerVariables[x][pDriveLicense] > 0)
{
playerVariables[x][pDriveLicense] -= 1;
if(playerVariables[x][pDriveLicense] == 0)
{
SendClientMessage(x,COLOR_RED,"Your driving license has expired!");
}
}
if(playerVariables[x][pGunLicense] > 0)
{
playerVariables[x][pGunLicense] -= 1;
if(playerVariables[x][pGunLicense] == 0)
{
SendClientMessage(x,COLOR_RED,"Your gun license has expired!");
}
}
if(playerVariables[x][pFlyLicense] > 0)
{
playerVariables[x][pFlyLicense] -= 1;
if(playerVariables[x][pFlyLicense] == 0)
{
SendClientMessage(x,COLOR_RED,"Your fly license has expired!");
}
}
if(playerVariables[x][pBoatLicense] > 0)
{
playerVariables[x][pBoatLicense] -= 1;
if(playerVariables[x][pBoatLicense] == 0)
{
SendClientMessage(x,COLOR_RED,"Your boat license has expired!");
}
}
if(playerVariables[x][pSeconds] >= 1800)
{
playerVariables[x][pPlayingHours]++;
if(playerVariables[x][pGiftHours] > 0)
{
if(playerVariables[x][pGiftHours] == 0)
{
SCM(x,COLOR_YELLOW,"You can now use /getgift.");
}
playerVariables[x][pGiftHours] --;
}
}
else
{
SCM(x,COLOR_LIGHTBLUE,"Nu ai jucat suficient pentru a primi ora jucata.");
}
if(playerVariables[x][pGroupRank] == 7)
{
playerVariables[x][pBankMoney] += 50000;
SCM(x,COLOR_WHITE,"Ai primit $50.000 salariu de leader.");
}
if(playerVariables[x][pDonate] == 1)
{
playerVariables[x][pBankMoney] += playerVariables[x][pLevel] * 10000;
format(szMessage, 256, "Premium bonus: $%s", NumberFormat(playerVariables[x][pLevel] * 10000));
SCM(x, -1, szMessage);
}
if(playerVariables[x][pDonate] == 1)
{
playerVariables[x][pRobPoints]+= 2;
playerVariables[x][pRPoints]+= 2;
if(playerVariables[x][pFPunish] > 0)
{
playerVariables[x][pFPunish] -= 2;
if(playerVariables[x][pFPunish] < 1)
{
playerVariables[x][pFPunish] = 0;
}
}
}
if(playerVariables[x][pDonate] == 0)
{
playerVariables[x][pRobPoints]++;
playerVariables[x][pRPoints]++;
if(playerVariables[x][pFPunish] > 0)
{
playerVariables[x][pFPunish] --;
}
}
format(szMessage, sizeof(szMessage), "Paycheck: $%d | Bank balance: $%d | Bank interest: $%d | Tax: $%d (%d percent) | Normal earnings: $%d", RandPay, playerVariables[x][pBankMoney], BankInterest, taxamount, assetVariables[1][aAssetValue], TotalPay-taxamount);
SendClientMessage(x, COLOR_GREY, szMessage);
SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");
playerVariables[x][pSeconds] = 0;
savePlayerData(x);
}
return 1;
}
Imagini / Video (optional):
Edited by TheCrazyAti incercat sa rezolvati singur?:da
hh
1 answer to this question
Recommended Posts