Bool function on new syntax, since you need to iterate through every client, I guess the earlier return point could help a bit(?)
Code:
public bool playerHasLowestHealth(int client)
{
if (!IsValidClient(client)) {
return false;
}
int clientHp = GetClientHealth(client);
for (int i = 1; i <= MAXPLAYERS; i++) {
if (!IsValidClient(i) || !IsPlayerAlive(i)) {
continue;
} else if (GetClientHealth(i) < clientHp) {
return false;
}
}
return true;
}
stock bool IsValidClient(int client, bool nobots = false)
{
if (client <= 0 || client > MaxClients || !IsClientConnected(client) || (nobots && IsFakeClient(client)) || !IsClientInGame(client)) {
return false;
}
return true;
}