Payday problem
#1

Hello All << Today I tried to type PayDay [/payday] and its not showing any of the Payday like OLD BALANCE << New Balance or anything like that
Here is the codes:

pawn Код:
YCMD:payday(playerid, params[], help) {
    if(help) {
        SendClientMessage(playerid, X11_WHITE, "Starts a payday");
        return 1;
    }
    Payday();
    return 1;
}

new lastpayday;
jobsOnGameModeInit() {
    for(new i=0;i<sizeof(JobPickups);i++) {
    new jmsg[900];
    format(jmsg,sizeof(jmsg), "{FFFFFF}Stand on the icon to get \"{FF0000}%s{FFFFFF}\" job",JobPickups[i][EJobName]);
        JobPickups[i][EJobText] = CreateDynamic3DTextLabel(jmsg, 0xFFFFFFFF, JobPickups[i][EJobPickupX], JobPickups[i][EJobPickupY], JobPickups[i][EJobPickupZ]+0.7, 30.0,INVALID_PLAYER_ID, INVALID_VEHICLE_ID,0,JobPickups[i][EJobPickupVW], JobPickups[i][EJobPickupInt]);
        JobPickups[i][EJobPickupID] =  CreateDynamicPickup(1239, 16,  JobPickups[i][EJobPickupX], JobPickups[i][EJobPickupY], JobPickups[i][EJobPickupZ], JobPickups[i][EJobPickupVW], JobPickups[i][EJobPickupInt]);
    }
    new Hour, Minute, Second;
    new timenow = gettime(Hour,Minute, Second);
    timenow -= (Minute*30)-Second;
    lastpayday = timenow;
    //new minsleft = 60-Minute; //minutes left until next pay day
    //new timeleft = ((minsleft * 60)-Second) * 1000;
    //printf("payday in: %d %d\n",minsleft,timeleft);
    //paydaytimer = SetTimerEx("Payday",timeleft,false,"d",1);
}
new payhour = -1;
checkPayday() {
    new Hour, Minute, Second;
    gettime(Hour,Minute, Second);
    new timenow = gettime();
    if(Hour != payhour) {
        if(timenow > lastpayday+3600 && (Minute > 0 && Minute < 5)) {
            payhour = Hour;
            lastpayday = gettime();
            Payday();
        }
    }
}
Payday() {
        new Hour, Minute, Second;
        gettime(Hour,Minute, Second);
        //printf("payday timer called at %02d:%02d:%02d\n",Hour,Minute, Second);
        SetWorldTime(Hour);
        new string[128];
       
        turfsOnPayDay();
        plantsOnPayday();
        //swapWeather();
        foreach(Player, i) {
            if(!IsPlayerConnectEx(i)) {
                continue;
            }
            new logintime = GetPVarInt(i, "CharLoginTime");
            if(gettime() - logintime < 600) {
                SendClientMessage(i, X11_TOMATO_2, "You haven't been playing long enough to earn a paycheck(10 minutes)!");
                continue;
            }
            new level = GetPVarInt(i, "Level");
            new paycheck = GetPVarInt(i, "Payday");
            paycheck += 1000;
            if(level >= 10) {
                paycheck += 1000 + (level * 100);
            } else {
                paycheck += 500 + (level * 100);
            }
            new account = GetPVarInt(i, "Bank");
            //Everything is calculated, display it all
            SendClientMessage(i, COLOR_GREENISHGOLD, "|___ BANK STATEMENT ___|");
            format(string, sizeof(string), "  Paycheck: $%s", getNumberString(paycheck));
            SendClientMessage(i, COLOR_GREEN, string);
            format(string, sizeof(string), "  Balance: $%s", getNumberString(account));
            SendClientMessage(i, COLOR_GREEN, string);
            if(server_taxrate != 0) {
                new Float:tax = server_taxrate*0.01;
                new rtax = floatround(tax*paycheck);
                format(string, sizeof(string), "  Tax: %d percent ($%s)", server_taxrate,getNumberString(rtax));
                SendClientMessage(i, COLOR_GREEN, string);
                account -= rtax;
            }
            new ticketprice = GetPVarInt(i, "TicketTotal");
            if(ticketprice > 0) {
                new tprice = floatround(ticketprice/5.0);
                format(string, sizeof(string), "  Unpaid Ticket Fine: -$%s",getNumberString(tprice));
                SendClientMessage(i, COLOR_GREEN, string);
                account -= tprice;
            }
            //SendClientMessage(i, COLOR_GREEN, string);
            //format(string, sizeof(string), "  Rent: -$%s", getNumberString(rent));
            new housetax = getHouseTax(i);
            if(housetax > 2000) housetax = 2000;
            format(string, sizeof(string), "  Property Tax: -$%s", getNumberString(housetax));
            SendClientMessage(i, COLOR_GREEN, string);
            new rprice = getRentPrice(i);
            if(rprice != 0) {
                format(string, sizeof(string), "  Rent: -$%s", getNumberString(rprice));
                SendClientMessage(i, COLOR_GREEN, string);
                account -= rprice;
            }
            new uflags = GetPVarInt(i, "UserFlags");
            if(uflags & EUFHasCarInsurance) {
                new insuranceprice = getInsurancePaydayPrice(i);
                format(string, sizeof(string), "  Vehicle Insurance: -$%s", getNumberString(insuranceprice));
                SendClientMessage(i, COLOR_GREEN, string);
                account -= insuranceprice;
            }
            if(uflags & EUFHasHealthInsurance) {
                new hprice = getHealthInsurancePrice(i);
                format(string, sizeof(string), "  Health Insurance: -$%s", getNumberString(hprice));
                SendClientMessage(i, COLOR_GREEN, string);
                account -= hprice;
            }
            new rentcarprice = GetTotalRentCarPrice(i);
            if(rentcarprice != 0) {
                format(string, sizeof(string), "  Car Rentals: -$%s",getNumberString(rentcarprice));
                SendClientMessage(i, COLOR_GREEN, string);
                account -= rentcarprice;
            }
            paycheck += getFactionPay(i);
            account -= housetax;
            SetPVarInt(i, "Bank", account);
            /* Double Bonus START */
            if(server_doublebonus != 0) {
                SetPVarInt(i, "RespectPoints", GetPVarInt(i, "RespectPoints")+2);
            } else {
                SetPVarInt(i, "RespectPoints", GetPVarInt(i, "RespectPoints")+1);
            }
            /* Double Bonus END */
            new ctime = GetPVarInt(i, "ConnectTime");
            if(++ctime == 50) {
                new dps = GetPVarInt(i, "DonatePoints");
                dps += 10;
                SetPVarInt(i, "DonatePoints",dps);
                GiveMoneyEx(i, 10000);
                dps = GetPVarInt(i, "Cookies");
                dps++;
                SetPVarInt(i, "Cookies", dps);
                format(string, sizeof(string), "* %s has reached 50 playing hours, and recieved $10,000, 10 donator points,and a cookie!",GetPlayerNameEx(i, ENameType_CharName));
                SendGlobalAdminMessage(X11_YELLOW,string);
                SendClientMessage(i, COLOR_LIGHTGREEN, "* You have reached 50 playing hours, and have recieved $10,000, 10 donator points, and a cookie! Congratulations!");
                SetPlayerColor(i, getNameTagColour(i));
            }
           
            if(numPlayersOnServer() < 5) {
                new bonus = floatround(paycheck*0.10);
                format(string, sizeof(string), "((  Low Player Bonus: $%s ))", getNumberString(bonus));
                SendClientMessage(i, COLOR_GREEN, string);
                paycheck += bonus;
            }
            /*
            if(numPlayersOnServer() > 80) {
                new bonus = floatround(paycheck*0.50);
                format(string, sizeof(string), "((  High Player Bonus: $%s ))", getNumberString(bonus));
                SendClientMessage(i, COLOR_GREEN, string);
                paycheck += bonus;
            }
            */

            SetPVarInt(i, "ConnectTime", ctime);
            format(string, sizeof(string), "  New Balance: $%s ($%s)", getNumberString(account),getNumberString(account+paycheck));
            //doBankSettlement(i);
            SendClientMessage(i, COLOR_GREEN, string);
            SendClientMessage(i, COLOR_GREENISHGOLD, "|---------------------------------|");
            SendClientMessage(i, X11_WHITE, "(( You've recieved a Paycheck! Use /signcheck or /sc to claim it! ))");
            /* Double Bonus START */
            if(server_doublebonus != 0) {
                SetPVarInt(i, "PayCheque", paycheck*2);
            } else {
                SetPVarInt(i, "PayCheque", paycheck);
            }
            /* Double Bonus END */
            DeletePVar(i, "Payday");
            GameTextForPlayer(i, "~g~Pay Day", 5000, 1);
        }
        playLotto();
}
Reply
#2

Can anyone help me please?
Reply
#3

Can you provide screenshots or chat logs or something along the lines so I can see what you mean by "this balance isn't showing", etc.?
Reply
#4

I will give you an example: When the type is 12:00 or something like that the payday is not showing like LOS SANOTS PAYCHECK --------------------
Interest: 100$ Old Paycheck: 250$
New Paycheck: 500$
I already add the codes
Reply
#5

Can't understand anything...
Reply
#6

I need to see what's happening in-game.

Post some gyazos or something of the chatbox, or use chatlogs to show us.

I need to see exactly what's happening and what is not working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)