Payday
#1

Hello sampers, i made tax system on payday but i got problem sometime on payday tax goes 1-2 milions but usualy should be 3-20k max based on levels i don't know why sometime for all tax goes example 2milions :/

pawn Код:
public PayDay()
{
    new string[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
            if(PlayerInfo[i][pLevel] > 0)
            {
                new tax = (Tax / 2)*(PlayerInfo[i][pLevel]);
                if(PlayerInfo[i][pAccount] > PlayerInfo[i][pCash])
                {
                    PlayerInfo[i][pAccount] -= tax;
                    banksys[dCash] += tax;
                    SaveCityhallSystem()
                    format(string, sizeof(string), "  Tax: -$%d", tax);
                    SendClientMessage(i, COLOR_GREEN, string);
                }
                else
                {
                    PlayerInfo[i][pCash] -= tax;
                    banksys[dCash] += tax;
                    SaveCityhallSystem()
                    format(string, sizeof(string), "  Tax: -$%d", tax);
                    SendClientMessage(i, COLOR_GREEN, string);
                }
                if(PlayerInfo[i][pAddict] == 1)
                {
                    PlayerInfo[i][pExp]+= 4;
                }
                PlayerInfo[i][pExp]+= 2;
            }
        }
    }
    return 1;
}
this is for commands what president have he can check money from tax what is stored in city hall and use that cash

pawn Код:
public LoadCityhallSystem()
{
    new arrCoords[1][64];
    new strFromFile2[256];
    new File: file = fopen("LARP/cityhall.ini", io_read);
    if (file)
    {
        fread(file, strFromFile2);
        split(strFromFile2, arrCoords, ',');
        banksys[dCash] = strval(arrCoords[0]);
        fclose(file);
    }
    return 1;
}
public SaveCityhallSystem()
{
    new coordsstring[256];
    format(coordsstring, sizeof(coordsstring), "%d", banksys[dCash]);
    new File: file2 = fopen("LARP/cityhall.ini", io_write);
    fwrite(file2, coordsstring);
    fclose(file2);
    return 1;
}
I don't have idea what can couse problem to make tax 2milions :/

Regards,
Niko
Reply
#2

Can anyone help me?
Reply
#3

Mate , Tax depend on level's!!!
Quote:

new tax = (Tax / 2)*(PlayerInfo[i][pLevel]);

and decrease it by CMD
Quote:

/settax

I dont think there is any option to decrease the TAX
Reply
#4

Quote:
Originally Posted by PakistaniBaba
Посмотреть сообщение
Mate , Tax depend on level's!!!


and decrease it by CMD


I dont think there is any option to decrease the TAX
I know its based on levels -.-
Tax for level 3 example is 750$
But sometime for all tax is example 2m but should be based on level,i use /spayday cmd to test it i use it milion times on test server and it's all fine but on Main Server sometime just goes over milions and for all is same idk what can affect to payday so it give tax of 2milions
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)