Interest @ payday
#1

Heey guys

I made a payday myself and I just made a bank system but now I want that every payday you get tax of some part of the bank(I dont know that english word for but in dutch: procent).
Further I want also a line for interest of the bank money.
I have looked the forum but couldn't find anything only from the GF but I dont want to steal things.
Код:
public PayDay()
{
    new string[50];
    for(new i; i<MAX_PLAYERS; i++)
	if(logged[i] == 1)
	{
	    if(!dini_Exists(udb_encode(playername))) { dini_Create(udb_encode(playername)); }
   		SecondsPlayed[i] = dini_Int(udb_encode(playername), "secondsplayed");
   		SecondsPlayed[i]++;
   		if(SecondsPlayed[i] == 30)
   		{
		    {
				if(exp[i] <=4)
				{
		            exp[i] +=1;
					GivePlayerMoney(i, 1000);
					format(string, sizeof(string), " ___________________UD_STATEMENT_________________");
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Congratulations, you have now one more experience ");
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Your pocket money is $%d your new exp: %d ", GetPlayerMoney(i), exp[i]);
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Your bank money is $%d", PlayerInfo[i][Banka]);
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Type /stats to see your updates stats");
					SendClientMessage(i, COLOR_BLUE, string);
					continue;
				}
				GivePlayerMoney(i, 1000);
				SetPlayerScore(i, GetPlayerScore(i) + 1);
				exp[i] = 0;
				Score[i] = GetPlayerScore(i);
				format(string, sizeof(string), " ___________________UD_STATEMENT_________________");
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Congratulations, you have now one more experience ");
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Your pocket money is $%d your new exp: %d ", GetPlayerMoney(i), exp[i]);
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Your bank money is $%d", PlayerInfo[i][Banka]);
				SendClientMessage(i, COLOR_BLUE, string);
		  		if(DoesPlayerOwnBusiness(i) == 1)
				{
		            new biz[50];
					for(new b=0; b<MAX_BUSINESS; b++)
				    format(biz,sizeof(biz),"%iCash",b);
					new cash = dini_Int("Business.ini",biz);
					format(biz,sizeof(biz),"Your business contains $%i",cash);
					SendClientMessage(i,COLOR_WHITE,biz);
				}
				format(string, sizeof(string), "Congratulations, it is your birthday ");
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "You are now %d year's old  ", Score[i]);
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Type /stats to see your updates stats");
				SendClientMessage(i, COLOR_BLUE, string);
                SecondsPlayed[i] = 0;
				continue;
	    	}
        }
   		dini_IntSet(udb_encode(playername), "secondsplayed", SecondsPlayed[i]);
	}
	else
	{
	    SendClientMessage(i, COLOR_GREENBLUE,"You are not yet logged in, so you wont get payday!");
	}
	return 1;
}
I hope someone can help me

EDIT: Is something wrong with it? if you need more information please ask cause I realy hoped that you could help me
Reply
#2

Why does nobody react here but is on the others?
Reply
#3

pawn Код:
PlayerInfo[i][Banka]/100*percentage
ENG: This will give you the amount of tax you want them to get or lose. Just add it inside a message and give the player the money.

NL: Hierboven zie je hoe je de tax kan berekenen, als je dit toevoegt aan een SendClientMessage zoals alle andere heb je dat al, dan moet je enkel nog de speler het tax geld geven.

Hope that helped
Reply
#4

Код:
 public PayDay()
{
    new string[50];
    for(new i; i<MAX_PLAYERS; i++)
	if(logged[i] == 1)
	{
	        {
				if(exp[i] <=4)
				{
		            exp[i] +=1;
					GivePlayerMoney(i, 1000);
     				new rent;
					rent = (PlayerInfo[i][Banka]/100*bank_rent) - PlayerInfo[i][Banka];
					printf("Your current funds : $%d, you gained : $%d", PlayerInfo[i][Banka]+rent, rent);
					PlayerInfo[i][Banka] += rent;
					format(string, sizeof(string), " ___________________UD_STATEMENT_________________");
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Congratulations, you have now one more experience ");
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Your pocket money is $%d your new exp: %d ", GetPlayerMoney(i), exp[i]);
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Your current bank money is : $%d, you gained : $%d", PlayerInfo[i][Banka]+rent, rent);
					SendClientMessage(i, COLOR_BLUE, string);
					format(string, sizeof(string), "Type /stats to see your updates stats");
					SendClientMessage(i, COLOR_BLUE, string);
					continue;
				}
				GivePlayerMoney(i, 1000);

				SetPlayerScore(i, GetPlayerScore(i) + 1);
				exp[i] = 0;
				Score[i] = GetPlayerScore(i);
                new rent;
				rent = (PlayerInfo[i][Banka]/100*bank_rent) - PlayerInfo[i][Banka];
				printf("Your current funds : $%d, you gained : $%d", PlayerInfo[i][Banka]+rent, rent);
				PlayerInfo[i][Banka] += rent;
				format(string, sizeof(string), " ___________________UD_STATEMENT_________________");
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Congratulations, you have now one more experience ");
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Your pocket money is $%d your new exp: %d ", GetPlayerMoney(i), exp[i]);
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Your current bank money is : $%d, you gained : $%d", PlayerInfo[i][Banka]+rent, rent);
				SendClientMessage(i, COLOR_BLUE, string);
		  		format(string, sizeof(string), "Congratulations, it is your birthday ");
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "You are now %d year's old  ", Score[i]);
				SendClientMessage(i, COLOR_BLUE, string);
				format(string, sizeof(string), "Type /stats to see your updates stats");
				SendClientMessage(i, COLOR_BLUE, string);
                continue;
	    	}
        }
	else
	{
	    SendClientMessage(i, COLOR_GREENBLUE,"You are not yet logged in, so you wont get payday!");
	}
	return 1;
}
Oke Thank you now I have this
What do I do wrong now it gives 0 interest
I have #define bank_rent 105 at the top of my gamemode
Reply
#5

Please someone?
I dont know why no one react?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)