error 001: expected token: ",", but found ";"
#1

hey guys i got 1 error any ideas how to fix this?

Код:
error 001: expected token: ",", but found ";"
Line:
Код:
format(TimeStr,20,"%02d:%02d",(Hour,Min);
Reply
#2

Can you give me your full code please?
Reply
#3

Quote:
Originally Posted by Acres
Посмотреть сообщение
hey guys i got 1 error any ideas how to fix this?

Код:
error 001: expected token: ",", but found ";"
Line:
Код:
format(TimeStr,20,"%02d:%02d",(Hour,Min);
pawn Код:
format(TimeStr,20,"%02d:%02d",Hour,Min);
Btw, why is there "02"?
Reply
#4

Код:
public UpdateTime()
{
     new Hour,Min,Sec;
     gettime(Hour,Min,Sec);
     new TimeStr[20];
     format(TimeStr,20,"%02d:%02d",(Hour,Min);
     TextDrawSetString(TimeTD,TimeStr);
     return 1;
}
Reply
#5

pawn Код:
public UpdateTime()
{
     new Hour,Min,Sec;
     gettime(Hour,Min,Sec);
     new TimeStr[20];
     format(TimeStr,20,"%02d:%02d",Hour,Min);
     TextDrawSetString(TimeTD,TimeStr);
     return 1;
}
You opened your format, but it was never closed. (Because you missed a brace - you needed to add two, see quote). I'm not sure if this is a necessity or not, but I removed the opening brace of Hour,Min, I doubt it is though.

Quote:

format(TimeStr,20,"%02d:%02d",(Hour,Min));

Reply
#6

I think this will solve it.
format(TimeStr,20,"%02d:%02d",(Hour,Min));
Reply
#7

Quote:
Originally Posted by ProjectMan
Посмотреть сообщение
pawn Код:
format(TimeStr,20,"%02d:%02d",Hour,Min);
Btw, why is there "02"?
If you have a number that's less than 2 characters, it'll show up as "01" to "09".
%03d would give "001" and so on.

As for the answer to this thread, it's posted above. Your brackets aren't matching.
Reply
#8

Код:
public UpdateTime()
{
     new Hour,Min,Sec;
     gettime(Hour,Min,Sec);
     new TimeStr[20];
     format(TimeStr,20,"%02d:%02d",Hour,Min);
     TextDrawSetString(TimeTD,TimeStr);
     return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)