Got problem using custom public... [SOLVED]
#1

Код:
#define PAY_TIME 20000
#define CAR_TOWNING_PAY 20

forward StartPayingToCarTowning(playerid);
I have timer for public StartPayingToCarTowning...
Код:
SetTimer("StartPayingToCarTowning", PAY_TIME, 1);
and public
Код:
public StartPayingToCarTowning(playerid)
{
  new string[48];
  GivePlayerMoney(playerid, CAR_TOWNING_PAY);
  format(string, sizeof(string), "PAYDAY: You have been gained %s", CAR_TOWNING_PAY);
  SendClientMessage(playerid, COLOR_WHITE, string);
  print("20 second has passed and pay has been awarded for asfasg");
  return 0;
}
The problem is: Person who should get pay, just don't get it... it just start spamming to console
"20 second has passed and pay has been awarded for asfasg"


What's the problem? :S

This is solved now.
Reply
#2

Try using "return 1;" instead of "return 0;".

Cheers.
Reply
#3

The return has absolutely no effect on timers. On SetTimer change the third parameter to false
Reply
#4

Quote:
Originally Posted by dice7
The return has absolutely no effect on timers. On SetTimer change the third parameter to false
It just stop repeating it...
Still no effect when money should be added.
It doesn't not even print "PAYDAY: You have been gained %s" message to client... when it should.
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
	{
	if	(newstate==PLAYER_STATE_DRIVER)
	  {
		if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
		{
 		  print("Starting timer for PayCheckTowing...");
 		  SetTimer("StartPayingToCarTowning", PAY_TIME, false);
 		  print("Timer started...");
 		}
		if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 416)
 		{
 		  print("Starting timer for PayCheckAmbulance...");
 		  SetTimer("PayCheckAmbulance", PAY_TIME, false);
 		  print("Timer started...");
 		}
  }
 return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)