03.09.2015, 11:30
Is there any code for tht? Sorry, im a beginner lol
GetConnectedPlayers()
{
new
ConnectedPlayers;
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (!IsPlayerConnected(i) || i == INVALID_PLAYER_ID) continue;
ConnectedPlayers++;
}
return ConnectedPlayers;
}
GetConnectedPlayers()
{
new count;
foreach(new i : Player)
{
count++;
}
return count;
}
Using foreach is simpler.
pawn Код:
|
Oh, sorry. I left him the arduous job of Googling "foreach samp", and didn't spoon-feed him all of the code.
|