Jump to content
  • 0

PayDay


Gigel92abaz

Question

Problema intalnita (descriere): Cum as putea face sa pot primii payday-ul doar daca stau 5 minute pe server ca eu daca stau mai putin de 30 minute zice ca nu am jucat destul,as vrea sa fac sa stau doar 5 minute online si sa primesc payday nu 30..
Ero(area / rile) / warning-(ul / urile): Nu am
Liniile de cod / sursa / script-ul(obligatoriu):  
public PayDay()
{
    new string[128];
    new account,interest;
    new rent = 0;
    new rand;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[pLevel] > 0)
            {
                if(MoneyMessage==1)
                {
                    if(PlayerInfo[pJailTime] > 0)
                    {
                           new jaildm = PlayerInfo[pJailTime];
                           PlayerInfo[pJailTime] = (jaildm + 240);
                           SendClientMessage(i,0xE42217FF,"[WARNING]: Ai banii pe - in jail.Ai primit + 240 seconds jail !");
                        ResetPlayerWeapons(i);
                    }
                    else
                     {
                        SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
                        GameTextForPlayer(i, "~r~Busted!", 2000, 1);
                        SetPlayerInterior(i, 10);
                        PlayerInfo[pInt] = 10;
                        rand = random(sizeof(AjailSpawns));
                        SetPlayerPos(i, AjailSpawns[rand][0], AjailSpawns[rand][1], AjailSpawns[rand][2]);
                        PlayerInfo[pJailed] = 1;
                        ResetPlayerWeapons(i);
                        ResetPlayerMoney(i);
                        SetPlayerSkin(i, 62);
                        ResetPlayerWantedLevelEx(i);
                        WantedPoints = 0;
                        PlayerInfo[pWL] = 0;
                        PlayerInfo[pJailTime] = 240;
                        format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[pJailTime]);
                        SendClientMessage(i, COLOR_WHITE, string);
                    }
                }
                new playername2[MAX_PLAYER_NAME];
                GetPlayerName(i, playername2, sizeof(playername2));
                account = PlayerInfo[pAccount];
                new key = PlayerInfo[pPhousekey];
                new key2 = PlayerInfo[pPhousekey2];
                new key3 = PlayerInfo[pPhousekey3];
                if(key != 255)
                {
                    rent = HouseInfo[key][hRent];
                    if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
                    {
                        rent = 0;
                    }
                    else if(rent > GetPlayerMoney(i))
                    {
                        PlayerInfo[pPhousekey] = 255;
                        SendClientMessage(i, COLOR_WHITE, "You have been evicted.");
                        rent = 0;
                    }
                    HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
                    GivePlayerMoney(i, -rent)
                }
                else if(key2 != 255)
                {
                    rent = HouseInfo[key2][hRent];
                    if(strcmp(playername2, HouseInfo[key2][hOwner], true) == 0)
                    {
                        rent = 0;
                    }
                    else if(rent > GetPlayerMoney(i))
                    {
                        PlayerInfo[pPhousekey2] = 255;
                        SendClientMessage(i, COLOR_WHITE, "You have been evicted.");
                        rent = 0;
                    }
                    HouseInfo[key2][hTakings] = HouseInfo[key2][hTakings]+rent;
                    GivePlayerMoney(i, -rent)
                }
                else if(key3 != 255)
                {
                    rent = HouseInfo[key3][hRent];
                    if(strcmp(playername2, HouseInfo[key3][hOwner], true) == 0)
                    {
                        rent = 0;
                    }
                    else if(rent > GetPlayerMoney(i))
                    {
                        PlayerInfo[pPhousekey3] = 255;
                        SendClientMessage(i, COLOR_WHITE, "You have been evicted.");
                        rent = 0;
                    }
                    HouseInfo[key3][hTakings] = HouseInfo[key3][hTakings]+rent;
                    GivePlayerMoney(i, -rent)
                }
                new tmpintrate;
                if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
                {
                    if(PlayerInfo[pDonateRank] > 99) { tmpintrate = intrate+4; }
                    else { tmpintrate = intrate+3; }//HouseInfo[key][hLevel]
                }
                else
                {
                    if(PlayerInfo[pDonateRank] > 1) { tmpintrate = 2; }
                    else { tmpintrate = 1; }
                }
                if(PlayerInfo[pPayDay] >= 5)
                {
                    Tax += TaxValue;//Should work for every player online
                    PlayerInfo[pAccount] -= TaxValue;
                    new checks = PlayerInfo[pPayCheck] / 2;
                    if(PlayerInfo[pDonateRank] > 0)
                    {
                        new bonus = PlayerInfo[pPayCheck] / 5;
                        checks += bonus;
                    }
                    new ebill = 100*(PlayerInfo[pLevel]);
                    account += checks;
                    if(PlayerInfo[pPhousekey] != 255)
                    {
                        PlayerInfo[pAccount] -= ebill;
                        SBizzInfo[4][sbTill] += ebill;
                    }
                    else
                    {
                        ebill = 0;
                    }
                    interest = (PlayerInfo[pAccount]/1000)*(tmpintrate);
                    PlayerInfo[pExp]++;
                    PlayerPlayMusic(i);
                    PlayerInfo[pAccount] = account+interest;
                    SendClientMessage(i, COLOR_GREEN, "|___ BANK STATMENT ___|");
                    format(string, sizeof(string), "  Paycheck: %s   Tax Money: -%s", DecimalPoint(checks), DecimalPoint(TaxValue));
                    PlayerInfo[pRob] += 1;
                    SendClientMessage(i, COLOR_WHITE, string);
                    if(PlayerInfo[pPhousekey] != 255 || PlayerInfo[pPhousekey2] != 255 || PlayerInfo[pPhousekey3] != 255 || PlayerInfo[pPbiskey] != 255 || PlayerInfo[pPbiskey2] != 255)
                    {
                        format(string, sizeof(string), "  Electricity Bill: -%s", DecimalPoint(ebill));
                        SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[pCredit] > 0)
                    {
                        new getmoney = GetPlayerMoney(i);
                        new creditoffer = (((PlayerInfo[pAccount]) + getmoney)/750) * (PlayerInfo[pLevel]);
                        new creditt = PlayerInfo[pCredit];
                        PlayerInfo[pCredit] = (creditt - creditoffer);
                        GivePlayerMoney(i, -creditoffer);
                        format(string, sizeof(string), "Credit: -%s", DecimalPoint(creditoffer));
                        SendClientMessage(i, COLOR_WHITE, string);
                    }
                    format(string, sizeof(string), "  Balance: %s", DecimalPoint(account - checks));
                    SendClientMessage(i, COLOR_WHITE, string);
                    format(string, sizeof(string), "  Interest Rate: 0.%d percent",tmpintrate);
                    SendClientMessage(i, COLOR_GRAD2, string);
                    format(string, sizeof(string), "  Interest Gained %s", DecimalPoint(interest));
                    SendClientMessage(i, COLOR_GRAD3, string);
                    SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
                    format(string, sizeof(string), "  New Balance: %s", DecimalPoint(PlayerInfo[pAccount]));
                    SendClientMessage(i, COLOR_GRAD5, string);
                    format(string, sizeof(string), "  Rent: -%s", DecimalPoint(rent));
                    SendClientMessage(i, COLOR_GRAD5, string);
                    rent = 0;
                    PlayerInfo[pPayDay] = 0;
                    PlayerInfo[pPayCheck] = 0;
                    PlayerInfo[pConnectTime] += 1;
                    if(FarmerVar == 0)
                    {
                        FarmerPickup[0] = 0;
                    }
                    if(PlayerInfo[pAnularePermisTime] > 0)
                    {
                        PlayerInfo[pAnularePermisTime] -= 1;
                        if(PlayerInfo[pAnularePermisTime] <= 0)
                        {
                            PlayerInfo[pAnularePermisTime] = 0;
                            SendClientMessage(i, COLOR_GRAD5, "De acum poti sa iti iei din nou licenta de condus.");
                        }
                    }
                    if(PlayerInfo[pAsigurare] > 0)
                    {
                        PlayerInfo[pAsigurare] -= 1;
                        if(PlayerInfo[pAsigurare] <= 0)
                        {
                            PlayerInfo[pAsigurare] = 0;
                            SendClientMessage(i, COLOR_GRAD5, "Asigurarea ta a expirat.Daca ti-a fost de folos te invitam sa achizitonezi una noua.");
                        }
                    }
                    if(PlayerInfo[pDonateRank] > 99)
                    {
                        PlayerInfo[pPayDayHad] += 1;
                        if(PlayerInfo[pPayDayHad] >= 5)
                        {
                            PlayerInfo[pExp]++;
                            PlayerInfo[pPayDayHad] = 0;
                          }
                    }
                    format(string, sizeof(string), "~y~PayDay~n~~w~Check paid into your account");
                    GameTextForPlayer(i, string, 5000, 1);
                }
                else
                {
                    SendClientMessage(i, COLOR_WHITE, "[PayDay]: You haven't played long enough to obtain a PayDay.");
                }
            }
        }
    }
    SaveAccounts();
    Checkprop();
    return 1;
}
Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Da...

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Pai de ce sal faci la 5 minute?

Este mai bine asa ca daca nu alti nu joaca de loc dar intra sa ia payday si ies!

Asta este sfatul meu!

                               http://i.imgur.com/NOsIYWt.png

                     Respecta si vei fi respectat. :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.