Added GetSteamAccountID function to IPlayerHelpers and native for sp (bug 5548, r=asherkin).

This commit is contained in:
Kyle Sanderson
2013-03-16 23:12:40 -04:00
parent e2b519a21e
commit 5951cbf7b9
5 changed files with 74 additions and 3 deletions
+18
View File
@@ -174,6 +174,23 @@ static cell_t sm_GetClientAuthStr(IPluginContext *pCtx, const cell_t *params)
return 1;
}
static cell_t sm_GetSteamAccountID(IPluginContext *pCtx, const cell_t *params)
{
int index = params[1];
if ((index < 1) || (index > g_Players.GetMaxClients()))
{
return pCtx->ThrowNativeError("Client index %d is invalid", index);
}
CPlayer *pPlayer = g_Players.GetPlayerByIndex(index);
if (!pPlayer->IsConnected())
{
return pCtx->ThrowNativeError("Client %d is not connected", index);
}
return pPlayer->GetSteamAccountID(!!params[2]);
}
static cell_t sm_IsClientConnected(IPluginContext *pCtx, const cell_t *params)
{
int index = params[1];
@@ -1651,6 +1668,7 @@ REGISTER_NATIVES(playernatives)
{"CanUserTarget", CanUserTarget},
{"ChangeClientTeam", ChangeClientTeam},
{"GetClientAuthString", sm_GetClientAuthStr},
{"GetSteamAccountID", sm_GetSteamAccountID},
{"GetClientCount", sm_GetClientCount},
{"GetClientInfo", sm_GetClientInfo},
{"GetClientIP", sm_GetClientIP},