diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index 0965efda..5e6f8295 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -87,6 +87,11 @@ static cell_t GetGameTime(IPluginContext *pContext, const cell_t *params) 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) { if (!g_SourceMod.IsMapRunning()) @@ -524,6 +529,7 @@ REGISTER_NATIVES(halflifeNatives) {"GetGameDescription", GetGameDescription}, {"GetGameFolderName", GetGameFolderName}, {"GetGameTime", GetGameTime}, + {"GetGameTickCount", GetGameTickCount}, {"GetRandomFloat", GetRandomFloat}, {"GetRandomInt", GetRandomInt}, {"IsDedicatedServer", IsDedicatedServer}, diff --git a/plugins/include/halflife.inc b/plugins/include/halflife.inc index 2a60bdad..12f122a2 100644 --- a/plugins/include/halflife.inc +++ b/plugins/include/halflife.inc @@ -128,6 +128,13 @@ native Float:GetEngineTime(); */ native Float:GetGameTime(); +/** + * Returns the game's internal tick count. + * + * @return Game tick count. + */ +native GetGameTickCount(); + /** * Returns the game description from the mod. *