02.06.2014, 01:37
Hope it's work
pawn Код:
CMD:admins(playerid, params[])
{
new online, string[128], string2[512], file[32], count = 0;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1)
{
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] && aDuty[i])
{
format(string, sizeof(string), "- [Level: %d] %s", PlayerInfo[i][pAdmin], NORPN(i));
if(count == 0)
{
strcat(string2, string);
}
if(count > 0)
{
strcat(string, "\n");
strcat(string2, string);
}
count++;
}
}
ShowPlayerDialog(playerid,DIALOG_ID,DIALOG_STYLE_LIST,"On Duty Admins:",string2,"Close","");//change the DIALOG_ID
}
else
{
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin])
{
if(!aDuty[i])
{
format(file, sizeof(file), "users/%s.ini",RPNU(i));
format(string, sizeof(string), "- [Level: %d] %s [Admin Name: %s]", PlayerInfo[i][pAdmin], NORPN(i), dini_Get(file, "AdminName"));
}
else
{
format(file, sizeof(file), "users/%s.ini",RPNU(i));
format(string, sizeof(string), "- [Level: %d] %s [RP Name: %s]", PlayerInfo[i][pAdmin], NORPN(i), dini_Get(file, "OldName"));
}
if(PlayerInfo[i][pGangMod]) strcat(string, " [Gang Mod]");
if(PlayerInfo[i][pFacMod]) strcat(string, " [Fac Mod]");
if(PlayerInfo[i][pDoorMod]) strcat(string, " [Door Mod]");
if(PlayerInfo[i][pBizMod]) strcat(string, " [Biz Mod]");
if(PlayerInfo[i][pHouseMod]) strcat(string, " [House Mod]");
if(PlayerInfo[i][pGameAffairs]) strcat(string, " [Game Affairs]");
if(count == 0)
{
strcat(string2,string);
}
else if(count > 0)
{
strcat(string, "\n");
strcat(string2, string);
}
count++;
}
}
ShowPlayerDialog(playerid,DIALOG_ID,DIALOG_STYLE_LIST,"Online Admins:",string2,"Close","");//change the DIALOG_ID
}
return 1;
}