Making bank interest code.
#1

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)

Код:
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,"=========================================");
		}
If someone can help me, please respond
Greetz,
Danny
Reply


Messages In This Thread
Making bank interest code. - by Danny - 01.12.2010, 12:44
Re: Making bank interest code. - by Haegon - 01.12.2010, 13:08
Re: Making bank interest code. - by leong124 - 01.12.2010, 13:25
Re: Making bank interest code. - by Danny - 01.12.2010, 14:16

Forum Jump:


Users browsing this thread: 1 Guest(s)