This commit is contained in:
Nicholas Hastings 2012-05-31 07:35:05 -04:00
commit 66220ba56a
2 changed files with 13 additions and 0 deletions

View File

@ -87,6 +87,11 @@ static cell_t GetGameTime(IPluginContext *pContext, const cell_t *params)
return sp_ftoc(gpGlobals->curtime); return sp_ftoc(gpGlobals->curtime);
} }
static cell_t GetGameTickCount(IPluginContext *pContext, const cell_t *params)
{
return gpGlobals->tickcount;
}
static cell_t CreateFakeClient(IPluginContext *pContext, const cell_t *params) static cell_t CreateFakeClient(IPluginContext *pContext, const cell_t *params)
{ {
if (!g_SourceMod.IsMapRunning()) if (!g_SourceMod.IsMapRunning())
@ -520,6 +525,7 @@ REGISTER_NATIVES(halflifeNatives)
{"GetGameDescription", GetGameDescription}, {"GetGameDescription", GetGameDescription},
{"GetGameFolderName", GetGameFolderName}, {"GetGameFolderName", GetGameFolderName},
{"GetGameTime", GetGameTime}, {"GetGameTime", GetGameTime},
{"GetGameTickCount", GetGameTickCount},
{"GetRandomFloat", GetRandomFloat}, {"GetRandomFloat", GetRandomFloat},
{"GetRandomInt", GetRandomInt}, {"GetRandomInt", GetRandomInt},
{"IsDedicatedServer", IsDedicatedServer}, {"IsDedicatedServer", IsDedicatedServer},

View File

@ -127,6 +127,13 @@ native Float:GetEngineTime();
*/ */
native Float:GetGameTime(); native Float:GetGameTime();
/**
* Returns the game's internal tick count.
*
* @return Game tick count.
*/
native GetGameTickCount();
/** /**
* Returns the game description from the mod. * Returns the game description from the mod.
* *