SA-MP Forums Archive
Gettime issue - 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: Gettime issue (/showthread.php?tid=475768)



Gettime issue - Elorreli - 14.11.2013

for some reason Gettime only returns the hour 12, no matter what hour it is, any ideas?

pawn Код:
new Hour, Minute, Second;
gettime(Hour, Minute, Second);



Re: Gettime issue - Voxel - 15.11.2013

This should work (using samp wiki)

pawn Код:
new Hour, Minute, Second;
new str[64];
gettime(Hour, Minute, Second);
format(gettime,sizeof(gettime), "Hour: %d, Minute: %d, Second: %d",Hour, Minute, Second);
SendClientMessageToAll(-1, str);



Re: Gettime issue - Elorreli - 15.11.2013

Quote:
Originally Posted by Voxel
Посмотреть сообщение
This should work (using samp wiki)

pawn Код:
new Hour, Minute, Second;
new str[64];
gettime(Hour, Minute, Second);
format(gettime,sizeof(gettime), "Hour: %d, Minute: %d, Second: %d",Hour, Minute, Second);
SendClientMessageToAll(-1, str);
It always retrieves hour 12


Re: Gettime issue - Konstantinos - 15.11.2013

It's like the time on the computer is always 12. Is it in localhost or not (VPS, host etc.)?


Re: Gettime issue - Elorreli - 15.11.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It's like the time on the computer is always 12. Is it in localhost or not (VPS, host etc.)?
It's on a VPS, I guess that could be the problem yes

Any idea how to.. fix that? The VPS is running on Debian 7

Correction, It's stuck on 11 AM


Re: Gettime issue - Konstantinos - 15.11.2013

Do:
pawn Код:
date -u
Does it say the time correctly?

I'm not a user of Debian (so I cannot tell you for sure) but those might help:

http://www.debian.org/doc/manuals/sy...dmin-time.html
https://wiki.debian.org/DateTime


Re: Gettime issue - Elorreli - 15.11.2013

Managed to fix it, thanks for the help