SA-MP Forums Archive
Get current timestamp - 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: Get current timestamp (/showthread.php?tid=349711)



Get current timestamp - baske007 - 09.06.2012

Hi all,

A simple quick question: how can I get the current system timestamp in PAWN? So not the timestamp of the ingame time, but the system time.

Thanks!


Re: Get current timestamp - ReneG - 09.06.2012

gettime()


Re: Get current timestamp - baske007 - 09.06.2012

Fail. Thanks!


Re : Get current timestamp - ricardo178 - 09.06.2012

Example of how to use it in a /time command.
pawn Код:
CMD:time(playerid, params[])
{
    new hour, minute, second;
    GetTime(hour, minute, second);
    new string[128];
    format(string, sizeof(string), "It's %d:%d:%d", hour, minute, second);
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}