Add GetTeamEntity native to SDKTools.
This commit is contained in:
parent
7f24f137d6
commit
ae8efdddcb
@ -219,6 +219,17 @@ static cell_t GetTeamClientCount(IPluginContext *pContext, const cell_t *params)
|
||||
return fn(g_Teams[teamindex].pEnt, 0);
|
||||
}
|
||||
|
||||
static cell_t GetTeamEntity(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
int teamindex = params[1];
|
||||
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
|
||||
{
|
||||
return pContext->ThrowNativeError("Team index %d is invalid", teamindex);
|
||||
}
|
||||
|
||||
return gamehelpers->EntityToBCompatRef(g_Teams[teamindex].pEnt);
|
||||
}
|
||||
|
||||
sp_nativeinfo_t g_TeamNatives[] =
|
||||
{
|
||||
{"GetTeamCount", GetTeamCount},
|
||||
@ -226,5 +237,6 @@ sp_nativeinfo_t g_TeamNatives[] =
|
||||
{"GetTeamScore", GetTeamScore},
|
||||
{"SetTeamScore", SetTeamScore},
|
||||
{"GetTeamClientCount", GetTeamClientCount},
|
||||
{"GetTeamEntity", GetTeamEntity},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -259,6 +259,15 @@ native SetTeamScore(index, value);
|
||||
*/
|
||||
native GetTeamClientCount(index);
|
||||
|
||||
/**
|
||||
* Returns the entity index of a team.
|
||||
*
|
||||
* @param teamIndex Team index.
|
||||
* @return Entity index of team.
|
||||
* @error Invalid team index.
|
||||
*/
|
||||
native int GetTeamEntity(int teamIndex);
|
||||
|
||||
/**
|
||||
* Sets the model to a given entity.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user