Added GetGameTickCount native (bug 5209, r=psychonic).

This commit is contained in:
Tony 2012-05-30 14:13:43 +01:00
parent 44d9551bd6
commit f65de3bbbb
4 changed files with 16 additions and 3 deletions

View File

@ -43,7 +43,7 @@ class SM:
'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
'HL2SDKL4D': 'hl2sdk-l4d',
'HL2SDKL4D2': 'hl2sdk-l4d2',
'MYSQL5': 'mysql-5.0'
# 'MYSQL5': 'mysql-5.0'
}
if AMBuild.target['platform'] != 'darwin':
@ -403,7 +403,7 @@ FileList = [
['extensions', 'cstrike', 'AMBuilder'],
['extensions', 'curl', 'AMBuilder'],
['extensions', 'geoip', 'AMBuilder'],
['extensions', 'mysql', 'AMBuilder'],
# ['extensions', 'mysql', 'AMBuilder'],
['extensions', 'sdktools', 'AMBuilder'],
['extensions', 'topmenus', 'AMBuilder'],
['extensions', 'updater', 'AMBuilder'],

View File

@ -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},

View File

@ -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.
*

View File

@ -224,7 +224,7 @@ AddHL2Library('sourcemod', 'bin')
AddNormalLibrary('sourcemod.logic', 'bin')
AddNormalLibrary('sourcepawn.jit.x86', 'bin')
AddNormalLibrary('geoip.ext', 'extensions')
AddNormalLibrary('dbi.mysql.ext', 'extensions')
#AddNormalLibrary('dbi.mysql.ext', 'extensions')
AddNormalLibrary('dbi.sqlite.ext', 'extensions')
AddNormalLibrary('game.cstrike.ext.2.ep2v', 'extensions')