19.06.2015, 13:49
Let's assume I have this code:
Everything seems to be fine, but the line which calls the timer when a player connects gives some errors:
So, what is the right syntax? Or the include is not really suitable for per-player timers?
EDIT: fixed, if anybody will need this, make sure you don't have any unnecessary spaces, for example:
pawn Код:
new currentValue [MAX_PLAYERS], Timer:playerTimer[MAX_PLAYERS];
public OnPlayerConnect (playerid)
{
playerTimer[playerid] = repeat exampleTimer(playerid);
return (true);
}
timer exampleTimer[1000](playerid)
{
currentValue [playerid] ++;
if (currentValue [playerid] == 10)
stop playerTimer[playerid];
return (true);
}
Код:
error 076: syntax error in the expression, or invalid function call warning 215: expression has no effect error 001: expected token: ";", but found ")" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line
EDIT: fixed, if anybody will need this, make sure you don't have any unnecessary spaces, for example:
pawn Код:
repeat UpdateProgressBarValue(playerid); - this is good.
repeat UpdateProgressBarValue (playerid); - this is wrong