13.08.2014, 14:40
I have a loop in a command that loops through all the players online to see if they're an admin, but I want it to tell the command user if there are no admins online. How would I do this?
CMD:admins(playerid,params[])
{
new count = 0;
new string[128],name[50];
new name1[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i,name1,MAX_PLAYER_NAME);
if(IsPlayerAdmin(i)) // change to your admins
{
{name = "{9900CC}Server Owner";}
format(string, 128, "%s - %s", name1,name);
SendClientMessage(playerid, COLOR_WHITE, string);
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,COLOR_GREY,"There are no Admins Online at the moment");
return 1;
}