warning 235: public function lacks forward declaration (symbol "settime")
#1

solved
Reply
#2

Public functions need to be forwarded, so

pawn Код:
forward settime();
public settime()
{
    new hour,minute,second;
    new string[256];
    gettime(hour,minute,second);
    if (minute <= 9){format(string,25,"%d:0%d:%d",hour,minute,second);}
    else {format(string,25,"%d:%d:%d",hour,minute,second);}
    TextDrawSetString(Clock,string);
    SetWorldTime(hour);
    return 1;
}
Reply
#3

thanks alot bro
Reply
#4

You should write it like this:

PHP код:
forward settime();
public 
settime()
{
    new 
hour,minute,second,string[16];
    
gettime(hour,minute,second),
    
format(string,sizeof(string),"%d:%02d:%02d",hour,minute,second),
    
TextDrawSetString(Clock,string),
    
SetWorldTime(hour);
    return 
1;

Much cleaner Code and there is always a 0 before
Reply
#5

Thank you
Reply
#6

Don't be selfish.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)