25.09.2013, 19:49
gettime() comes as a unix timestamp, however, by using gettime like as follows, you can get the exact hour, minute and second:
And then you can use those for anything in your command or callback or whatever you want to use it for. Here's an example:
A Unix Timestamp is used on SA-MP mainly for temporary systems, you can see more about the unix timestamp here: http://en.wikipedia.org/wiki/Unix_time, and you can see how to use it in SA-MP here: https://sampforum.blast.hk/showthread.php?tid=254915.
pawn Код:
new hours, minutes, seconds;
gettime(hours, minutes, seconds);
pawn Код:
CMD:time(playerid, params[], help)
{
new hours, minutes, seconds, string[50];
gettime(hours, minutes, seconds);
format(string, sizeof(string), "The time is %d hours, %d minutes and %d seconds.", hours, minutes, seconds);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}