What should I do about these warnings?
#1

Here's my code:
PHP код:
new File:ftw=fopen("server/komande.txt"io_append), string[100], name[MAX_PLAYER_NAME], YearMonthDayDatumHourMinuteSecondVrijeme;
Datum getdate(YearMonthDay);
Vrijeme gettime(HourMinuteSecond);
GetPlayerName(playeridnamesizeof(name));
format(stringsizeof(string), "%s: %s | %d/%d/%d | %dh:%dm:%ds\r\n"namecmdtextDayMonthYearHourMinuteSecond);
fwrite(ftwstring);
fclose(ftw); 
When I compile it it all works correctly and as I wanted it to, but I get these warnings:
warning 204: symbol is assigned a value that is never used: "Vrijeme"
warning 204: symbol is assigned a value that is never used: "Datum"

I know why I get them and what they mean, and I know that I can just type in like "printf("%d %d", Datum, Vrijeme);" but I want to know what can I change in my code so that i don't have to do it that way.
Any help is appreciated.
Reply
#2

PHP код:
new File:ftw=fopen("server/komande.txt"io_append), string[100], name[MAX_PLAYER_NAME], YearMonthDayHourMinuteSecond;
getdate(YearMonthDay);
gettime(HourMinuteSecond);
GetPlayerName(playeridnamesizeof(name));
format(stringsizeof(string), "%s: %s | %d/%d/%d | %dh:%dm:%ds\r\n"namecmdtextDayMonthYearHourMinuteSecond);
fwrite(ftwstring);
fclose(ftw); 
try now.
Reply
#3

Since you are not doing anything with them, just make it like this:

PHP код:
getdate(YearMonthDay); 
gettime(HourMinuteSecond); 
instead of
PHP код:
Datum getdate(YearMonthDay); 
Vrijeme gettime(HourMinuteSecond); 
Reply
#4

You are not doing anything with that variables, just remove them before the "gettime" and "getdate".
Reply
#5

add stock before the var to mute the warnings.
Reply
#6

I feel so stupid now because I tried it the way i pasted up there and I tried it without the gettime() and getdate() function completely and it would put just zeros in the txt file, I just couldn't think of trying without the "Datum" and "Vrijeme" in front...anyways, thank you, after all that's what this section is for, right hahahaha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)