Wont take cash from account
#1

Hello,this is part of my payday where should tax been taken from account. but money just don't want to go down remain same. And on string where is tax says example for level 10 tax is 2,000$ but money don't go down.

pawn Код:
*
                if(PlayerInfo[i][pPayDay] >= 0)
                {
                    new tax = (Tax / 2)*(PlayerInfo[i][pLevel]);
                    if(PlayerInfo[i][pLevel] > 2)
                    {
                        PlayerInfo[i][pCash] -= tax;
                        banksys[dCash] += tax;
                        SaveCityhallSystem()
                        format(coordsstring2, sizeof(coordsstring2),"{48CCCD}|_________________________ {157DEC}Bank Statement{48CCCD} __________________________|");
                        format(coordsstring3, sizeof(coordsstring3),"\n{157DEC}Government Tax:{48CCCD} -$%d", tax);
                    }
Reply
#2

Not sure but if you mean the money under your health bar,
that just won't change if you change the values of variables.
You have to use GivePlayerMoney(playerid, - or +);

i'd recommend you do
ResetPlayerMoney(playerid);
and then
GivePlayerMoney(PlayerInfo[i][pCash]);//after you've taken the taxes


but if you did mean the money on the bank,
you should do:
banksys[dCash] -= tax;
instead of
banksys[dCash] += tax;
and you shouldn't use taxes here:
PlayerInfo[i][pCash]
since youre taking it only from their bank account.
Otherwise they'll get it withdrawn twice, hand + bank
Reply
#3

Quote:
Originally Posted by CutX
Посмотреть сообщение
Not sure but if you mean the money under your health bar,
that just won't change if you change the values of variables.
You have to use GivePlayerMoney(playerid, - or +);

i'd recommend you do
ResetPlayerMoney(playerid);
and then
GivePlayerMoney(PlayerInfo[i][pCash]);//after you've taken the taxes


but if you did mean the money on the bank,
you should do:
banksys[dCash] -= tax;
instead of
banksys[dCash] += tax;
and you shouldn't use taxes here:
PlayerInfo[i][pCash]
since youre taking it only from their bank account.
Otherwise they'll get it withdrawn twice, hand + bank
dCash is defined as City Hall cash i made a save so President can use money of taxes. I know how to make it goes from bank. But when i put money goes from bank it does but not in - if i have 0 and payday come it wont take money in - you dont go in debt.
So i changed it to take from hands but it dosent work. If i do GivePlayerMoney how can i define then ammount of tax? i made so it counts the half of levels x seted tax like you are level 10:2 x example i did /settax 200 will be 5x200.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)