From 8bf7cb08f21dc3215c4fdc34842596b5e7e284f6 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Thu, 5 Jul 2007 14:47:36 +0000 Subject: [PATCH] added a time stamp argument to FormatTime --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401047 --- core/smn_core.cpp | 2 +- plugins/include/sourcemod.inc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/smn_core.cpp b/core/smn_core.cpp index 777267d0..8548ab66 100644 --- a/core/smn_core.cpp +++ b/core/smn_core.cpp @@ -89,7 +89,7 @@ static cell_t FormatTime(IPluginContext *pContext, const cell_t *params) pContext->LocalToString(params[1], &buffer); pContext->LocalToString(params[3], &format); - time_t t = time(NULL); + time_t t = (params[4] == -1) ? time(NULL) : (time_t)params[4]; strftime(buffer, params[2], format, localtime(&t)); return 1; diff --git a/plugins/include/sourcemod.inc b/plugins/include/sourcemod.inc index fdd337a5..55cfecd2 100644 --- a/plugins/include/sourcemod.inc +++ b/plugins/include/sourcemod.inc @@ -270,9 +270,10 @@ native GetTime(bigStamp[2]={0,0}); * @param buffer Destination string buffer. * @param maxlength Maximum length of output string buffer. * @param format Formatting rules. + * @param stamp Optional time stamp. * @noreturn */ -native FormatTime(String:buffer[], maxlength, const String:format[]); +native FormatTime(String:buffer[], maxlength, const String:format[], stamp=-1); /** * Loads a game config file.