Help with taxes
#2

First of all, you will need a variable to store amount of total tax.
So put it at the top of your gamemode:
pawn Код:
new TotalTaxPaid;
Now you need to update this variable after someone pays some tax.
So your code will looks like:
pawn Код:
new random_money = 1000+random(15000);
    for(new i=GetMaxPlayers()-1; i >=0; i--)
    {
        if(!IsPlayerConnected(i))continue;
        GivePlayerMoney(i,-random_money);
        new string[128];
        TotalTaxPaid +=random_money; // update total tax
        format(string, 100, "You paid %d$ in taxes to finance the State. Total tax pays: $%d", random_money,TotalTaxPaid);
        SendClientMessage(i,COLOR_GREEN, string);
Also, you will need to save TotalTaxPaid if you don't want it to reset after each server's restart.
Reply


Messages In This Thread
Help with taxes - by Face9000 - 02.01.2012, 19:02
Re: Help with taxes - by Norck - 02.01.2012, 19:07
Re: Help with taxes - by Face9000 - 02.01.2012, 19:09
Re: Help with taxes - by Norck - 02.01.2012, 19:15
Re: Help with taxes - by Norck - 02.01.2012, 19:17
Re: Help with taxes - by Face9000 - 02.01.2012, 19:22

Forum Jump:


Users browsing this thread: 3 Guest(s)