Пример #1
0
static cell_t NotifyPostAdminCheck(IPluginContext *pContext, const cell_t *params)
{
    int client = params[1];

    IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(client);
    if (!pPlayer)
    {
        return pContext->ThrowNativeError("Client index %d is invalid", client);
    }
    else if (!pPlayer->IsInGame()) {
        return pContext->ThrowNativeError("Client %d is not in game", client);
    }
    else if (!pPlayer->IsAuthorized())
    {
        return pContext->ThrowNativeError("Client %d is not authorized", client);
    }

    pPlayer->NotifyPostAdminChecks();

    return 1;
}
Пример #2
0
size_t IsAuthIdConnected(char *authID)
{
	IGamePlayer *player;
	const char *authString;
	
	for (int playerIndex = playerhelpers->GetMaxClients()+1; --playerIndex > 0;)
	{
		player = playerhelpers->GetGamePlayer(playerIndex);
		if (player == NULL || !player->IsAuthorized())
		{
			continue;
		}
		
		if (!strcmp(player->GetAuthString(), authID)
			|| !strcmp(player->GetSteam2Id(), authID)
			|| !strcmp(player->GetSteam3Id(), authID)
			)
		{
			return playerIndex;
		}
	}

	return 0;
}