Countdown timer giving error :s
#7

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.

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);

}
Though I do not quite get what goal you have having functions like this.
Good luck
Reply


Messages In This Thread
Countdown timer giving error :s - by ~Dangun! - 11.05.2010, 18:12
Re: Countdown timer giving error :s - by Killa_ - 11.05.2010, 18:13
Re: Countdown timer giving error :s - by ~Dangun! - 11.05.2010, 18:16
Re: Countdown timer giving error :s - by Killa_ - 11.05.2010, 18:18
Re: Countdown timer giving error :s - by ~Dangun! - 11.05.2010, 18:20
Re: Countdown timer giving error :s - by Jokerstyle - 12.05.2010, 13:12
Re: Countdown timer giving error :s - by maij - 12.05.2010, 14:05

Forum Jump:


Users browsing this thread: 1 Guest(s)