Hello I have in my plugin this for loop
PHP Code:
int Cts[MAXPLAYERS + 1];
int number = 0;
for (int i = 1; i < MAXPLAYERS + 1;i++)
{
PrintToChatAll("Client Number %d",i);
if (IsClientConnected(i))
{
if (IsPlayerAlive(i))
{
if (GetClientTeam(i) == CS_TEAM_CT)
{
Cts[number] = i;
number++;
}
}
}
}
PrintToChatAll("Loop Next"); // only executes half the time in online server
It's supposed to get all Ct Team clients and put them in Cts array
When i am in my own lan server with bots this loop seems to work just fine
When i try it in a real server with a small number of players (for some reasons it does this more when there are less players) it seems to work half the time and in the other half it stops at client index 6 and the rest of the code under it doesn't get executed. (I am not the server owner and can't get the console output to know the error)