Jump to content
  • 0

Problema pPlayerHours


Raz0r

Question

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):
Ati incercat sa rezolvati singur?:da

Edited by TheCrazy
hh
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
1 oră în urmă, TheCrazy a spus:

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):
Ati incercat sa rezolvati singur?:da

Daca folosesti gamemode bugged+ucp nu iti va merge niciodata pana nu faci baza de date din nou, deoare ce are variabilele  incurcate

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.