[Help] Me making server /time
#9

hi guys right one question

how do i use this function to make my payday pay player every hour i have tried and failed lots of times (not that it a bad thing as i learnt how to do a few other things while trying to sort this)

this is my payday code not to hard it works fine on a timer but that means it pays an hour after the server was started and i need it to pay even if i have just started the server

Код:
public PayDay()
{
  for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		  if(AccountInfo[i][aLogged] == 1)
		  {
			if (GetPlayerTotalMoney(i) >= PayCutoff)
			{
				SendClientMessage(i,COLOR_WHITE,"[Info:] You are to rich dont expect a Giro this time");
				}
	 		new wstring[256];
	 		new intrate = 1*AccountInfo[i][aScore];
//			new randcheck = 999 + random(4999);
			new interest = (AccountInfo[i][aBank]/1000)*(intrate);
//			new Level = AccountInfo[i][aScore];
			new payday = BasePay*AccountInfo[i][aScore];
			new newbank = AccountInfo[i][aBank] + interest;
			new randtax = 20 + random(50);
			new Gtax = payday/randtax;
			SendClientMessage(i,COLOR_GREEN,"|_____________Bank_of_San_Andreas______________|");
			SendClientMessage(i,COLOR_GREEN,"|___________________PaySlip____________________|");
			format(wstring, sizeof(wstring), "~y~PayDay~n~~w~Paycheck: ~g~%d",payday);
			GameTextForPlayer(i, wstring, 5000, 1);
		  format(wstring, sizeof(wstring), "PayCheck: $%d", payday);
		  SendClientMessage(i,COLOR_WHITE, wstring);
		  format(wstring, sizeof(wstring), "Balance: $%d, Interest Gained: $%d, New Balance: $%d, Interest Rate: 0.%d percent", AccountInfo[i][aBank], interest, newbank, intrate);
		  SendClientMessage(i,COLOR_WHITE, wstring);
		  format(wstring, sizeof(wstring), "Government Taxes: $%d", Gtax);
		  SendClientMessage(i,COLOR_WHITE, wstring);
		  AccountInfo[i][aBank] += interest;
		  AccountInfo[i][aBank] -= Gtax;
		  AccountInfo[i][aBank] += payday;
			AccountInfo[i][aXP]++;
			if(AccountInfo[i][aReport] > 0)
			AccountInfo[i][aReport]--;
			if(AccountInfo[i][aTacklebox] > 0)
			AccountInfo[i][aTacklebox]--;
			SendClientMessage(i,COLOR_GREEN,"______________________________________________________________________________________");
			}
				else
				{
					SendClientMessage(i,COLOR_WHITE,"[Info:] Payday not received, not played long enough");
				}
			}
			else
			{
				SendClientMessage(i,COLOR_WHITE,"[Info:] You are not logged in, payday not received");
			}
		}
	}
i will post more if you need it but i cant see anything else that might be needed
Reply


Messages In This Thread
[Help] Me making server /time - by Mowgli - 17.09.2009, 11:53
Re: [Help] Me making server /time - by Correlli - 17.09.2009, 13:19
Re: [Help] Me making server /time - by Mowgli - 17.09.2009, 13:40
Re: [Help] Me making server /time - by Correlli - 17.09.2009, 14:03
Re: [Help] Me making server /time - by Mowgli - 17.09.2009, 14:05
Re: [Help] Me making server /time - by Calgon - 17.09.2009, 14:15
Re: [Help] Me making server /time - by Mowgli - 17.09.2009, 14:38
Re: [Help] Me making server /time - by Correlli - 17.09.2009, 14:53
Re: [Help] Me making server /time - by mister_ic3 - 18.11.2009, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)