Jump to content

Recommended Posts

Posted

Am si eu o problema legata de PayDay, mie imi da o suma foarte mare si as dorii sa micsorez acea suma sa imi dea mai putin, si nu stiu unde anume trebuie sa modific.

Cred ca am pus bine zona unde trebuie modificat!

Quote

public PayDay()
{
    new string[128],
        str[256],
        string3[128],
        interest,
        account[MAX_PLAYERS],
        hour,
        minn,
        sec,
        expamount,
        rent[MAX_PLAYERS];
    gettime(hour,minn,sec);
    foreach(Player,i)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[pLevel] >= 0)
            {
                new wakaname[25];
                GetPlayerName(i,wakaname,sizeof(wakaname));
                if(MoneyMessage==1)
                {
                    SendClientMessage(i, COLOR_LIGHTRED, "Nu ti-ai platit datoriile deoarece ai fost la inchisoare!.");
                    new rand;
                    rand = random(sizeof(gRandomJailSpawns));
                    SetPlayerInterior(i, 6);
                    SetPlayerPosEx(i,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
                    PlayerInfo[pJailed] = 1;
                    ResetPlayerWeaponsEx(i);
                    ResetPlayerWeapons(i);
                    WantedPoints = 0;
                    PlayerInfo[pJailTime] = 240;
                    format(string, sizeof(string), "Ati fost inchis pentru %d secunde. Fara Cautiune", PlayerInfo[pJailTime]);
                    SendClientMessage(i, COLOR_LIGHTBLUE, string);
                    Update(i,pJailedx);
                    Update(i,pJailTimex);
                    TogglePlayerControllable(i, 0);
                    SetTimerEx("UnFreezeStation", 1000, false, "i", i);
                }
                new key = PlayerInfo[pPhousekey];
                if(key != 0)
                {
                    rent = HouseInfo[key][hRent];
                    if(rent > GetPlayerCash(i) && strcmp(PlayerInfo[pNormalName], HouseInfo[key][hOwner], false) == 0)
                    {
                        PlayerInfo[pPhousekey] = 0;
                        Update(i,pPhousekeyx);
                    }
                    HouseInfo[key][hTakings] += rent;
                    mysql_format(SQL,str,sizeof(str),"UPDATE `houses` SET `Takings`='%d' WHERE `ID`='%d'",HouseInfo[key][hTakings],key);
                    mysql_tquery(SQL,str,"","");
                }
                new tmpintrate;
                if(PlayerInfo[pPremiumAccount] == 1)
                {
                    tmpintrate = 2;
                    new bonus = PlayerInfo[pPayCheck] / 2;
                    PlayerInfo[pPayCheck] += bonus;
                }
                else
                {
                    tmpintrate = 1;
                }
                account = PlayerInfo[pAccount];
                Tax += TaxValue;
                PlayerInfo[pAccount] -= TaxValue;
                new checks = PlayerInfo[pPayCheck];
                PlayerInfo[pAccount] += checks;
                interest = (PlayerInfo[pAccount]/20)*(tmpintrate);
                new finalinterest;
                SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
                SendClientMessage(i, COLOR_WHITE, "Salariul a fost platit, mergi la banca pentru a ridica banii");
                new stringsu[256];
                if(PlayerInfo[pPayDay] >= 1)
                {
                format(stringsu,sizeof(stringsu),"Ai jucat doar %d minute.(In total ai %d ore jucate)",PlayerInfo[pPayDay]/60+1,PlayerInfo[pConnectTime]);
                SendSplitMessage(i, COLOR_GREEN, stringsu);
                }
                if(PlayerInfo[pPayDay] >= 1800)
                {
                       PlayerInfo[pPremiumPoints]++;
                       Update(i, pPremiumPointsx);
                       SendClientMessage(i, COLOR_WHITE, "Ai primit 1 punct premium. La fiecare ora jucata (1800 secunde) primiti cate 1 punct premium");
                }
                   else
                   {
                        SendClientMessage(i, COLOR_WHITE, "Nu ai primit niciun punct premium pentru ca nu ai jucat 1800 de secunde.");
                }
                if(PlayerInfo[pRob] < 20)
                {
                       PlayerInfo[pRob]++;
                   }
                   else
                   {
                       SendClientMessage(i, COLOR_WHITE, "Nu ai primit niciun rob/free point pentru ca ai deja 20 rob/free points.");
                }
                if(PlayerInfo[pPayDay] >= 1800)
                {
                    PlayerInfo[pConnectTime] += 1;
                    PlayerInfo[pPaydayuri] += 1;
                    finalinterest = interest;
                    PlayerInfo[pPayDay] = 0;
                    if(PlayerInfo[pGiftTime] > 0)
                    {
                        PlayerInfo[pGiftTime] -= 1;
                        Update(i, pGiftTimex);
                    }
                }
                PlayerInfo[pExp] += 1;
                PlayerInfo[pAccount] += finalinterest;
                format(string, sizeof(string), "ORA FIXA: Ai primit %sLei | Bani in banca: %sLei | Dobanda: %sLei | Taxe: %sLei (10 procente)", FormatNumber(checks), FormatNumber(PlayerInfo[pAccount]), FormatNumber(finalinterest), FormatNumber(TaxValue));
                SendClientMessage(i, COLOR_GREY, string);
                format(string3, sizeof(string3), "Chirie: %sLei | Total bani castigati ora aceasta: %dLei", FormatNumber(rent), checks-TaxValue);
                SendClientMessage(i, COLOR_GREY, string3);
                SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
                format(string, sizeof(string), "~y~SALARIU PRIMIT DIN PARTEA SERVERULUI");
                GameTextForPlayer(i, string, 5000, 1);
                if(PlayerInfo[pCarLicT] > 0)
                {
                    PlayerInfo[pCarLicT] -= 1;
                }
                if(PlayerInfo[pFlyLicT] > 0)
                {
                    PlayerInfo[pFlyLicT] -= 1;
                }
                if(PlayerInfo[pBoatLicT] > 0)
                {
                    PlayerInfo[pBoatLicT] -= 1;
                }
                if(PlayerInfo[pGunLicT] > 0)
                {
                    PlayerInfo[pGunLicT] -= 1;
                }
                if(PlayerInfo[pFpunish] > 0)
                {
                    PlayerInfo[pFpunish]--;
                 }
                 if(PlayerInfo[pFpunish] < 0)
                 {
                    PlayerInfo[pFpunish] = 0;
                }
                if(PlayerInfo[pCarLicSuspend] > 0)
                {
                    PlayerInfo[pCarLicSuspend]--;
                    Update(i, pCarLicSuspendx);
                    if(PlayerInfo[pCarLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de condus a fost confiscata recent. Acum poti merge din nou la scoala de soferi pentru a lua licenta din nou.");
                }
                if(PlayerInfo[pGunLicSuspend] > 0)
                {
                    PlayerInfo[pGunLicSuspend]--;
                    Update(i, pGunLicSuspendx);
                    if(PlayerInfo[pGunLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de arme a fost confiscata recent. Acum poti da din nou testul cu un instructor pentru a lua licenta din nou.");
                }
                   if(IsACop(i))
                {
                    PlayerInfo[pLawyer] += 1;
                }
                PlayerInfo[pPayCheck] = 0;
                if(PlayerInfo[pLevel] == 1 || PlayerInfo[pLevel] == 2 || PlayerInfo[pLevel] == 3 || PlayerInfo[pLevel] == 4)
                {
                    expamount = PlayerInfo[pLevel]*2;
                    if(PlayerInfo[pExp] >= expamount)
                    {
                        SCM(i,COLOR_LIGHTBLUE,"** Nu poti cumpara un Nivel deoarece nu ai destule Puncte de Respect.");
                    }
                }
                else if(PlayerInfo[pLevel] >= 5)
                {
                    expamount = PlayerInfo[pLevel]*3;
                    if(PlayerInfo[pExp] >= expamount)
                    {
                        SCM(i,COLOR_LIGHTBLUE,"** Nu poti cumpara un Nivel deoarece nu ai destule Puncte de Respect.");
                    }
                }
            }
        }
    }
    for(new x = 0; x < MAX_GROUPS; x++)
    {
        DynamicFactions[x][fBank] += DynamicFactions[x][fPaydayMoney];
        mysql_format(SQL,str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);
        mysql_tquery(SQL,str,"","");
    }
    return 1;
}

 

Posted (edited)

interest = (PlayerInfo[pAccount]/20)*(tmpintrate);

sau iti poti face un randomex sa ofere un salariu dupa cum doresti tu. (scuze, nu ma pricep la modurile RPG)

Adaugi asta undeva unde nu incurca in special jos de tot (aproape de sfarsitul liniilor ale gm-ului)

randomEx(min, max) return (random((max - min)) + min);

Bani = randomEx(5000, 10000000) // 5000 = de unde incepe suma, 10000000 pana unde poate ajunge suma!

exemplu

new Bani = randomEx(5000, 10000000);

PlayerInfo[pAccount] += Bani;

 

Edited by Iulian1337
Posted

Ok, am inteles care este linia, dar i-mi poti spune te rog si ce trebuie modificat? sa bag 20-ul mai mic?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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.