Fix GetClientCount(false)

This commit is contained in:
BotoX
2023-08-30 22:08:46 +02:00
committed by Your Name
parent aa2a71fc67
commit ec3351a320
4 changed files with 50 additions and 15 deletions
+1 -12
View File
@@ -270,18 +270,7 @@ static cell_t sm_GetClientCount(IPluginContext *pCtx, const cell_t *params)
return playerhelpers->GetNumPlayers();
}
int maxplayers = playerhelpers->GetMaxClients();
int count = 0;
for (int i = 1; i <= maxplayers; ++i)
{
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(i);
if ((pPlayer->IsConnected()) && !(pPlayer->IsInGame()))
{
count++;
}
}
return (playerhelpers->GetNumPlayers() + count);
return playerhelpers->GetNumClients();
}
static cell_t sm_GetMaxClients(IPluginContext *pCtx, const cell_t *params)