02.01.2012, 19:07
First of all, you will need a variable to store amount of total tax.
So put it at the top of your gamemode:
Now you need to update this variable after someone pays some tax.
So your code will looks like:
Also, you will need to save TotalTaxPaid if you don't want it to reset after each server's restart.
So put it at the top of your gamemode:
pawn Код:
new TotalTaxPaid;
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);