Added GetGameFolderName() native
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40727
This commit is contained in:
parent
5c6ba68e4b
commit
3cdd3c0d0d
@ -140,6 +140,16 @@ static cell_t GetGameDescription(IPluginContext *pContext, const cell_t *params)
|
||||
return numBytes;
|
||||
}
|
||||
|
||||
static cell_t GetGameFolderName(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
const char *name = g_SourceMod.GetModFolderName();
|
||||
size_t numBytes;
|
||||
|
||||
pContext->StringToLocalUTF8(params[1], params[2], name, &numBytes);
|
||||
|
||||
return numBytes;
|
||||
}
|
||||
|
||||
static cell_t GetCurrentMap(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
size_t bytes;
|
||||
@ -277,6 +287,7 @@ REGISTER_NATIVES(halflifeNatives)
|
||||
{"GetCurrentMap", GetCurrentMap},
|
||||
{"GetEngineTime", GetEngineTime},
|
||||
{"GetGameDescription", GetGameDescription},
|
||||
{"GetGameFolderName", GetGameFolderName},
|
||||
{"GetGameTime", GetGameTime},
|
||||
{"GetRandomFloat", GetRandomFloat},
|
||||
{"GetRandomInt", GetRandomInt},
|
||||
|
@ -314,6 +314,16 @@ native Float:GetGameTime();
|
||||
*/
|
||||
native GetGameDescription(String:buffer[], maxlength, bool:original=false);
|
||||
|
||||
/**
|
||||
* Returns the name of the game's directory.
|
||||
*
|
||||
* @param buffer Buffer to store the directory name.
|
||||
* @param maxlength Maximum size of the buffer.
|
||||
*
|
||||
* return Number of bytes written to the buffer (UTF-8 safe).
|
||||
*/
|
||||
native GetGameFolderName(String:buffer[], maxlength);
|
||||
|
||||
/**
|
||||
* Returns the current map name.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user