// change this line if(IsPlayerConnected(i) && IsPlayerSpawned(i))// too thisif(IsPlayerConnected(i) && IsPlayerSpawned[i])