Help with my Script.
#1

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;
}
Reply
#2

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
Reply
#3

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

new playerid;


Reply
#4

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

still getting same error
Reply
#6

anyone else be able to help me??
Reply
#7

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.
Reply
#8

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

That's why I corrected myself.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)