if(strcmp(cmd,"/admins", true) == 0)
{
new string[258];
if(preso[playerid] == 0)
{
SendClientMessage(playerid, 0x7A7A7AAA, "• [BGL] Administradores e Moderadores Conectados •");
new aname[MAX_PLAYER_NAME];
new countADM[playerid] = 0;
new countMOD[playerid] = 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][Admin] == 1)
{
GetPlayerName(i,aname,sizeof(aname));
format(string,sizeof(string),"%s {008000}[ Moderador ]", aname);
SendClientMessage(playerid, -1, string);
countMOD[playerid]++;
}
else if(PlayerInfo[i][Admin] == 2)
{
GetPlayerName(i,aname,sizeof(aname));
format(string,sizeof(string),"%s {FF0000}[ Administrador ]", aname);
SendClientMessage(playerid, -1, string);
countADM[playerid]++;
}
else if(PlayerInfo[i][Admin] == 3)
{
GetPlayerName(i,aname,sizeof(aname));
format(string,sizeof(string),"%s {FF0000}[ Administrador ]", aname);
SendClientMessage(playerid, -1, string);
countADM[playerid]++;
}
}
}
if(countMOD[playerid] == 0)
{
SendClientMessage(playerid, -1, "[ BGL ] {FF0000}Nenhum Moderador online no momento.");
}
if(countADM[playerid] == 0)
{
SendClientMessage(playerid, -1, "[ BGL ] {FF0000}Nenhum Administrador online no momento.");
}
}
else
{
SendClientMessage(playerid,-1,"[ ERRO ] {FF0000}Vocк nгo pode usar comandos estando preso.");
}
return 1;
}
|
Yes, let's post foreign code in the English section of the forum.
![]() |
nDuty[MAX_PLAYERS];" at the top of your script and when a player goes on duty, use onDuty[playerid] = true;CMD:admins(playerid, params[])
{
new pName[MAX_PLAYER_NAME], message[128];
SCM(playerid, -1, "Admins online:");
foreach(new i : Player) // assuming you use foreach.
{
if(IsPlayerAdmin(i))
{
GetPlayerName(i, pName, sizeof(pName));
if(onDuty[i] == true) // or whatever variable you use.
{
format(message, sizeof(message), "%s (ID %d)", pName, i);
SendClientMessage(playerid, COLOR_GREEN, message);
}
else
{
format(message, sizeof(message), "%s (ID %d)", pName, i);
SendClientMessage(playerid, -1, message);
}
}
}
return 1;
}