little problem - 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: little problem (
/showthread.php?tid=552650)
little problem -
Jhony_Blaze - 25.12.2014
Hello guys, I got a little problem, I got this code here where the date wouldn't show normally, it shows the server was last restarted at "time" on "date" but "date" doesn't show the year correctly, it only shows 201 and not 2014.
PHP код:
format(lastrestart, sizeof(lastrestart), "*** {33AA33}The server was last restarted at %s on %s.", gLastRestartedTime, gLastRestartedDate);
Re : little problem -
StreetRP - 25.12.2014
Quote:
Originally Posted by Jhony_Blaze
Hello guys, I got a little problem, I got this code here where the date wouldn't show normally, it shows the server was last restarted at "time" on "date" but "date" doesn't show the year correctly, it only shows 201 and not 2014.
PHP код:
format(lastrestart, sizeof(lastrestart), "*** {33AA33}The server was last restarted at %s on %s.", gLastRestartedTime, gLastRestartedDate);
|
String size probably to small ?
Re: little problem -
Jhony_Blaze - 25.12.2014
And how can I fix that ?
AW: little problem -
Flori - 25.12.2014
add this instead of yours xs
Re : little problem -
StreetRP - 25.12.2014
Can you show me the code ?
Or you have
Change it to
AW: Re : little problem -
Flori - 25.12.2014
Quote:
Originally Posted by StreetRP
Can you show me the code ?
Or you have
Change it to
|
One tip, DO NOT make this! It's an unneeded to big size.
Re : AW: Re : little problem -
StreetRP - 25.12.2014
Quote:
Originally Posted by Flori
One tip, DO NOT make this!
|
And Why ?!
Re: little problem -
Jhony_Blaze - 25.12.2014
I had
Код:
new lastrestart[128];
I am gonna try with
AW: Re : AW: Re : little problem -
Flori - 25.12.2014
Quote:
Originally Posted by StreetRP
And Why ?!
|
Why making that string so big if you just need a size of 128? It's unneeded. Or count the letters one by one. You will never reach 256 LOL, then use 140, bc just one letter missed also 129 would be enough.
Re : little problem -
StreetRP - 25.12.2014
But he had 128 and doesent work