SA-MP Forums Archive
What should I do about these warnings? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What should I do about these warnings? (/showthread.php?tid=652937)



What should I do about these warnings? - AmarPlayer - 22.04.2018

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.


Re: What should I do about these warnings? - Zeus666 - 22.04.2018

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.


Re: What should I do about these warnings? - jasperschellekens - 22.04.2018

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



Re: What should I do about these warnings? - Similarty - 22.04.2018

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


Re: What should I do about these warnings? - std - 22.04.2018

add stock before the var to mute the warnings.


Re: What should I do about these warnings? - AmarPlayer - 22.04.2018

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