new data[100]; format(data,sizeof(data),"players on-line: %d ", GetPlayerPoolSize() ); // SendClientMessage // TextDraw // etc...
new count = 0, string[50]; for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { if(IsPlayerConnected(i)) count++; } format(string,sizeof(string),"Players OnLine: %d",count);
Код:
new data[100]; format(data,sizeof(data),"players on-line: %d ", GetPlayerPoolSize() ); // SendClientMessage // TextDraw // etc... |
Код:
new count = 0, string[50]; for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { if(IsPlayerConnected(i)) count++; } format(string,sizeof(string),"Players OnLine: %d",count); |
stock JugadoresOnline()
{
new count = 0, string[50];
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerConnected(i)) count++;
}
format(string, sizeof(string), "Jugadores Online %d", count);
return 1;
}
JugadoresOnline();
SetTimer("JugadoresOnline", 100000, true);//Los nъmeros son el tiempo por el cual aparece el texto
new
players = 0,//variable para almacenar la cantidad de jugadores online
strings[32];//cadena string para almacenar el texto a enviar con la cantidad de jugdaores online
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)if(IsPlayerConnected(i)) players++; //hace un ciclo tomando la ID del jugador mas alto conectado y va preguntando ID por ID y si esta conectado, suma +1 a la variable players
format(strings,sizeof(strings),"Jugadores Online: %d",players);//almacenar en la cadena strings la cantidad de jugadores online
SendClientMessageToAll(-1, strings);//enviar mensaje a todos los jugadores conectados con la cantidad de jugadores online