SA-MP Forums Archive
Help with my Script. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with my Script. (/showthread.php?tid=113616)



Help with my Script. - crazydc - 14.12.2009

Hello i have been trying to get my payday to work right. It not given any players any money just doing nothink other then sending the player one message "Payday is here!" If any one could help i would be most thankfull.

Код:
forward Payday(playerid);
Код:
SetTimer("Payday", 60000 , true); // Every 1 minutes the Timer will go off.900000
Код:
public Payday(playerid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
  	new payday = 200;
  	if(IsPlayerConnected(i))
    {
			if(AccountInfo[i][pTeam] == 1)
			{
				SendClientMessage(i, COLOUR_TRECE, "[Payday]: You recieve your paycheck.");
				GivePlayerMoney(i, payday);
			}
			else if(AccountInfo[i][pTeam] == 2)
			{
				SendClientMessage(i, COLOUR_TRECE, "[Payday]: Sup, Holmes heres your cut.");
				GivePlayerMoney(i, payday);
			}
			else if(AccountInfo[i][pTeam] == 3)
			{
				SendClientMessage(i, COLOUR_HELLSANGELS, "[Payday]: Sup, Kid heres your cut.");
				GivePlayerMoney(i, payday);
			}
			else if(AccountInfo[i][pTeam] == 4)
			{
				SendClientMessage(i, COLOUR_CAPPELLI, "[Payday]: Your cut from the don.");
				GivePlayerMoney(i, payday);
			}
			else if(AccountInfo[i][pTeam] == 5)
			{
				SendClientMessage(i, COLOUR_NORTHSIDE, "[Payday]: Sup, Dawg here's your cut.");
				GivePlayerMoney(i, payday);
			}
			else
			{
				SendClientMessage(i, COLOUR_OTHER, "[Payday]: You have recieved a Welfare Cheque.");
				GivePlayerMoney(i, 100);
			}
			print("Payday Function Called");
			OnPlayerUpdateAccount(i);
  		GameTextForAll("Payday is here!", 5000, 3 );
			return 1;
    }
  }
  return 1;
}



Re: Help with my Script. - LarzI - 14.12.2009

Change
pawn Код:
SetTimer("Payday", 60000 , true); // Every 1 minutes the Timer will go off.900000
To:
pawn Код:
SetTimerEx( "Payday", 60000 , true, "i", playerid ); // Every 1 minutes the Timer will go off.900000



Re: Help with my Script. - crazydc - 14.12.2009

it telling me that playerid is undefined do i need to add in

new playerid;





Re: Help with my Script. - LarzI - 14.12.2009

You need to set the timer inside OnPlayerConnect/OnPlayerSpawn or something.


Re: Help with my Script. - crazydc - 14.12.2009

still getting same error


Re: Help with my Script. - crazydc - 14.12.2009

anyone else be able to help me??


Re: Help with my Script. - LarzI - 14.12.2009

Quote:
Originally Posted by lrZ^ aka LarzI
Change
pawn Код:
SetTimer("Payday", 60000 , true); // Every 1 minutes the Timer will go off.900000
To:
pawn Код:
SetTimerEx( "Payday", 60000 , true, "i", playerid ); // Every 1 minutes the Timer will go off.900000
Change back to what you changed from, then change:
pawn Код:
public PayDay(playerid)
//and
forward PayDay(playerid);
To:
pawn Код:
public PayDay()
//and
forward PayDay();
___

And you said you got an error?
Post it here.


Re: Help with my Script. - Tigerbeast11 - 14.12.2009

Why do u need public Payday(playerid) when u don't even use playerid?


Re: Help with my Script. - LarzI - 14.12.2009

That's why I corrected myself.


Re: Help with my Script. - Tigerbeast11 - 14.12.2009

yh, i saw ur post but it looked the same earlier lol