CMD:admins(playerid, params[])
{
new DialogAdminsMort[1200];
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerDados[i][Escondido] == false)
{
if(PlayerDados[i][Admin] == 2) AdminNivel = "2";
if(PlayerDados[i][Admin] == 3) AdminNivel = "3";
if(PlayerDados[i][Admin] == 4) AdminNivel = "4";
if(PlayerDados[i][Admin] == 5) AdminNivel = "5";
if(PlayerDados[i][Escondido] == false)
{
if(PlayerDados[i][Admin] == 1) // ADMINS VIP
{
format(String, 300, " {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [VIP]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
strcat(DialogAdminsMort, String);
continue;
}
if(PlayerDados[i][Admin] > 1)
{
format(String, 300, " {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [Nнvel: %s]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
strcat(DialogAdminsMort, String);
}
}
}
}
}
if (strlen(DialogAdminsMort) > 0)
ShowPlayerDialog(playerid, 9000, DIALOG_STYLE_MSGBOX, "{FF0000}Administradores/Vips Onlines", DialogAdminsMort, "Fechar", ""); // Depois Mude se quiser ^^
else
SendClientMessage(playerid, BRANCO, "{B0C4DE}Administraзгo offline no momento !"); // No admins are online
return true;
}
Cria uma variбvel de contador exemplo: new count;
E incrementa ela depois do for: count++ Fazendo isso, vocк terб a variбvel count o nъmero de membros online. Depois й sу utilizar ela |
CMD:admins(playerid, params[])
{
new
DialogAdminsMort[ 1200 ],
count = 0;
;
for(new i = 0; i <= GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerDados[i][Admin] >= 1)
{
switch(PlayerDados[i][Admin]){
case 2: AdminNivel = "2";
case 3: AdminNivel = "3";
case 4: AdminNivel = "4";
case 5: AdminNivel = "5";
}
if(PlayerDados[i][Escondido] == false)
{
if(PlayerDados[i][Admin] == 1)
{
format(String, 300, " {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [VIP]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
strcat(DialogAdminsMort, String);
}
if(PlayerDados[i][Admin] > 1)
{
format(String, 300, " {009DFF}[ID:%i] - {FFFFFF}%s{009DFF} - [Nнvel: %s]\n", i, Nome(i), AdminNivel); // Add the name of the admin-player to the list
strcat(DialogAdminsMort, String);
}
}
count++;
}
}
}
if(count > 0)
ShowPlayerDialog(playerid, 9000, DIALOG_STYLE_MSGBOX, "{FF0000}Administradores/Vips Onlines", DialogAdminsMort, "Fechar", ""); // Depois Mude se quiser ^^
else
SendClientMessage(playerid, BRANCO, "{B0C4DE}Administraзгo offline no momento !"); // No admins are online
return true;
}