Jump to content

Question

Posted

Problema intalnita (descriere): Am vrut sa adaug comanda payday,si am luat tot de la public payday si sa ii pun CMD,a mers totul cum trebuie la compile dar cand incerc sa folosesc in joc comanda payday nu merge,ce sa ii fac?
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu):

------------------------------------------------------------------------------------------------------------------------------------

CMD:payday(playerid, params[])

{
        foreach(Player, x)
        {
            new
                BankInterest = playerVariables[x][pBankMoney] / 350,
                RandPay = (random(65) + 5) * (playerVariables[x][pPlayingHours]/60) + random(50) + 50,
                TotalPay = BankInterest + RandPay;
                SendClientMessage(x, COLOR_TEAL, "----------------------------------------------------------------------------");
                SendClientMessage(x, COLOR_GREY, "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] >= 900)
                {
                    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][pDonate] == 1)
                {
                    playerVariables[x][pBankMoney] += playerVariables[x][pLevel] * 10;
                    format(szMessage, 256, "Premium bonus: $%s", NumberFormat(playerVariables[x][pLevel] * 10));
                    SCM(x, COLOR_GREY, 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;
                new wakaname2[25];
                GetPlayerName(x,wakaname2,25);
                new str[128];
                format(str,128,"UPDATE `playeraccounts` SET `playerHours`='%d' WHERE `playerName`='%s'",playerVariables[x][pPlayingHours],playerVariables[x][pInternalID]);
                mysql_tquery(handle,str);
                savePlayerData(x);
        }
    return 1;
}

------------------------------------------------------------------------------------------------------------------------------------


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: Da,am incercat si nu merge comanda

8 answers to this question

Recommended Posts

  • 0
Posted

Mhm, de ce nu ai facut, ca la comanda sa se apeleze functia PayDay in loc sa copiezi tot ce ai in functia PayDay..

 

 

Nu mai deschideti in pu*a mea servere de SA:MP !

Jucati-va pe cele care sunt !   Sunt suficiente !

Reguli de bun simt:

1. Nu faceti reclama unde nu trebuie !

2. Nu injurati ca la usa cortului !

3. Daca esti analfabeti, taci din gura !

4. Nu abuza de 'scuze', 'din greseala' !

 

My work ::: http://pastebin.com/VRNRcaAs

  • 0
Posted

Încearcă puțin să pui în loc de:

foreach(Player, x)
foreach(new x: Player)

 

  • 0
Posted

Mhm, de ce nu ai facut, ca la comanda sa se apeleze functia PayDay in loc sa copiezi tot ce ai in functia PayDay..

 

 

Imi poti explica te rog cum pot face asta?

  • 0
Posted (edited)
CMD:payday(playerid, params[])
{

    PayDay();//Apelezi functia PayDay().

}

 

Edited by Punct.
  • Upvote 1

Nu mai deschideti in pu*a mea servere de SA:MP !

Jucati-va pe cele care sunt !   Sunt suficiente !

Reguli de bun simt:

1. Nu faceti reclama unde nu trebuie !

2. Nu injurati ca la usa cortului !

3. Daca esti analfabeti, taci din gura !

4. Nu abuza de 'scuze', 'din greseala' !

 

My work ::: http://pastebin.com/VRNRcaAs

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.