Gettime issue
#1

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);
Reply
#2

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);
Reply
#3

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
Reply
#4

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

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
Reply
#6

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
Reply
#7

Managed to fix it, thanks for the help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)