01.12.2010, 12:44
Hi,
Does anyone know what's wrong with this piece of code? It gives the players wrong amounts of money (too much or negative amounts)
If someone can help me, please respond ![Smiley](images/smilies/smile.png)
Greetz,
Danny
Does anyone know what's wrong with this piece of code? It gives the players wrong amounts of money (too much or negative amounts)
Код:
public Paycheck() { new pstring[128]; for(new i=0; i<MAX_PLAYERS; i++) { if(gTeam[i] == TEAM_CIVILIAN) { GetPlayerName(i, iname, sizeof(iname)); pInfo[i][bankmoney] = dini_Int(iname,"bankmoney"); SendClientMessage(i, COLOR_YELLOW,"=============|PAYCHECK|================="); SendClientMessage(i, COLOR_GREEN,"Workless money: $500"); GivePlayerMoney(i, 500); SendClientMessage(i, COLOR_GREEN,"Extra money due playtime: $500"); GivePlayerMoney(i, 500); format(str, sizeof str,"Bank Interest: 2 percent ($%d + $%d)",pInfo[i][bankmoney],(pInfo[i][bankmoney]/100)*2); dini_IntSet((iname),"bankmoney",(pInfo[i][bankmoney]/100)*2); SendClientMessage(i, COLOR_GREEN, str); format(pstring, sizeof pstring,"Incoming Tax: -$%d",INCOMINGTAX); SendClientMessage(i, COLOR_RED, pstring); GivePlayerMoney(i, -INCOMINGTAX); SendClientMessage(i, COLOR_YELLOW,"========================================="); }
![Smiley](images/smilies/smile.png)
Greetz,
Danny