12.02.2018, 20:49
Well, let's suppose you want to get the number of players online in your server:
PHP код:
stock GetOnlinePlayersNumber()
{
new res=0;
for(new j=0;j<MAX_PLAYERS;j++) if(IsPlayerConnected(j))res++; else continue;
return res;
}
//Somewhere in your code...
new str[256];
format(str,sizeof str,"We have %d/50 players online",GetOnlinePlayersNumber());
SendClientMessage(playerid,-1,str);