Add native to get gpGlobals->frametime (#629)
This commit is contained in:
parent
7f71f43c2e
commit
44c744b8fd
@ -116,6 +116,11 @@ static cell_t GetGameTickCount(IPluginContext *pContext, const cell_t *params)
|
|||||||
return gpGlobals->tickcount;
|
return gpGlobals->tickcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t GetGameFrameTime(IPluginContext *pContext, const cell_t *params)
|
||||||
|
{
|
||||||
|
return sp_ftoc(gpGlobals->frametime);
|
||||||
|
}
|
||||||
|
|
||||||
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())
|
||||||
@ -607,6 +612,7 @@ REGISTER_NATIVES(halflifeNatives)
|
|||||||
{"GetGameFolderName", GetGameFolderName},
|
{"GetGameFolderName", GetGameFolderName},
|
||||||
{"GetGameTime", GetGameTime},
|
{"GetGameTime", GetGameTime},
|
||||||
{"GetGameTickCount", GetGameTickCount},
|
{"GetGameTickCount", GetGameTickCount},
|
||||||
|
{"GetGameFrameTime", GetGameFrameTime},
|
||||||
{"GetRandomFloat", GetRandomFloat},
|
{"GetRandomFloat", GetRandomFloat},
|
||||||
{"GetRandomInt", GetRandomInt},
|
{"GetRandomInt", GetRandomInt},
|
||||||
{"IsDedicatedServer", IsDedicatedServer},
|
{"IsDedicatedServer", IsDedicatedServer},
|
||||||
|
@ -211,6 +211,13 @@ native float GetGameTime();
|
|||||||
*/
|
*/
|
||||||
native int GetGameTickCount();
|
native int GetGameTickCount();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the time the Game took processing the last frame.
|
||||||
|
*
|
||||||
|
* @return Game frame time.
|
||||||
|
*/
|
||||||
|
native float GetGameFrameTime();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the game description from the mod.
|
* Returns the game description from the mod.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user