Merge pull request #301 from alliedmodders/get-team-entity
Add GetTeamEntity native to SDKTools.
This commit is contained in:
commit
7268987461
@ -219,6 +219,17 @@ static cell_t GetTeamClientCount(IPluginContext *pContext, const cell_t *params)
|
|||||||
return fn(g_Teams[teamindex].pEnt, 0);
|
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[] =
|
sp_nativeinfo_t g_TeamNatives[] =
|
||||||
{
|
{
|
||||||
{"GetTeamCount", GetTeamCount},
|
{"GetTeamCount", GetTeamCount},
|
||||||
@ -226,5 +237,6 @@ sp_nativeinfo_t g_TeamNatives[] =
|
|||||||
{"GetTeamScore", GetTeamScore},
|
{"GetTeamScore", GetTeamScore},
|
||||||
{"SetTeamScore", SetTeamScore},
|
{"SetTeamScore", SetTeamScore},
|
||||||
{"GetTeamClientCount", GetTeamClientCount},
|
{"GetTeamClientCount", GetTeamClientCount},
|
||||||
|
{"GetTeamEntity", GetTeamEntity},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -259,6 +259,15 @@ native SetTeamScore(index, value);
|
|||||||
*/
|
*/
|
||||||
native GetTeamClientCount(index);
|
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.
|
* Sets the model to a given entity.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user