15.01.2015, 17:44
It's simple, look into the following:
gettime
getdate
and
format
Here is an example;
and:
Then use this:
format(string, sizeof(string), "[%s - %s] ...", NewDate(), NewTime());
SendClientMessage(playerid, -1, string);
^^ - would print as:
[15/01/2015 - 18:27] ...
gettime
getdate
and
format
Here is an example;
pawn Код:
stock NewDate()
{
new Year, Month, Day, string[30];
getdate(Year, Month, Day);
format(string, sizeof(string), "%02d/%02d/%d", Day, Month, Year);
return string;
}
pawn Код:
stock NewTime()
{
new Hour, Minute, Second, string[30];
gettime(Hour, Minute, Second);
format(string, sizeof(string), "%02d:%02d:%02d", Hour, Minute, Second);
return string;
}
format(string, sizeof(string), "[%s - %s] ...", NewDate(), NewTime());
SendClientMessage(playerid, -1, string);
^^ - would print as:
[15/01/2015 - 18:27] ...