SA-MP Forums Archive
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(lastrestartsizeof(lastrestart), "*** {33AA33}The server was last restarted at %s on %s."gLastRestartedTimegLastRestartedDate); 



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(lastrestartsizeof(lastrestart), "*** {33AA33}The server was last restarted at %s on %s."gLastRestartedTimegLastRestartedDate); 
String size probably to small ?
Quote:

lastrestart




Re: little problem - Jhony_Blaze - 25.12.2014

And how can I fix that ?


AW: little problem - Flori - 25.12.2014

pawn Код:
new lastrestart[128];
add this instead of yours xs


Re : little problem - StreetRP - 25.12.2014

Can you show me the code ?

Or you have
Quote:

lastrestart[avalue]

Change it to
Quote:

lastrestart[256]




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

Код:
lastrestart[256]



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