12.05.2010, 14:05
problem 1. Round_time doesn't have a return value. Therefore it's not considered as a integer (number) and is an invalid expression.
2. You call the function the wrong way. ROUND_TIME is an invalid expression. should be ROUND_TIME()
3. you probably intended to multiply round_time with 60, then substract gtimepassed. Even though the original code works, I suggest usng brackets.
Though I do not quite get what goal you have having functions like this.
Good luck
2. You call the function the wrong way. ROUND_TIME is an invalid expression. should be ROUND_TIME()
3. you probably intended to multiply round_time with 60, then substract gtimepassed. Even though the original code works, I suggest usng brackets.
pawn Код:
public ROUND_TIME()
{
new string[265];
format(string,sizeof(string),"Test round is over");
SendClientMessageToAll(0x33CCFFAA,string);
return 60;//value
}
public Timer()
{
gTimePassed++;
new timeleft = ((ROUND_TIME() * 60) - gTimePassed); //This is the error line :S
new minutes = (timeleft / 60);
new seconds = (timeleft - minutes * 60);
new tmpmsg[128];
format(tmpmsg,sizeof(tmpmsg),"%d:%d",minutes, seconds);
TextDrawSetString(TimerCD, tmpmsg);
TextDrawShowForAll(TimerCD);
}
Good luck