22.12.2014, 14:21
When there are no administrators, it says, there are none.
But when there are, it just says: "Connected Administrators:"
Can anybody tell me why it doesn't work?
But when there are, it just says: "Connected Administrators:"
Can anybody tell me why it doesn't work?
pawn Код:
COMMAND:admins(playerid, params[])
{
new check = 0,
info[150];
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Connected Administrators:");
foreach(new i : Player)
{
if(PlayerInfo[i][pAdminlevel] > 0 && GetPVarInt(i, "AdminHide") == 0)
{
format(info, sizeof(info), "(Level: %i) %s (%s) (ID: %i) AdminDuty: %s", PlayerInfo[i][pAdminlevel], GetNameWithSpace(i), PlayerInfo[i][pForumName], i, GetPVarInt(i, "AdminDuty") == 1? ("Yes") : ("No"));
check++;
}
else if(check == 0) return SendClientMessage(playerid, COLOR_GREY, "*** There are currently no administrators connected.");
else
{
if(PlayerInfo[i][pBanAppealer] == 1) strcat(info, " [BA]");
if(PlayerInfo[i][pBanAppealer] == 2) strcat(info, " [DOBA]");
if(PlayerInfo[i][pShopTech] == 1) strcat(info, " [ST]");
if(PlayerInfo[i][pShopTech] == 2) strcat(info, " [SST]");
if(PlayerInfo[i][pShopTech] == 3) strcat(info, " [DOCR]");
if(PlayerInfo[i][pFactionModerator] == 1) strcat(info, " [FMOD]");
if(PlayerInfo[i][pFactionModerator] == 2) strcat(info, " [DOFM]");
if(PlayerInfo[i][pPR] == 1) strcat(info, " [PR]");
if(PlayerInfo[i][pPR] == 2) strcat(info, " [DOPR]");
if(PlayerInfo[i][pHR] >= 1) strcat(info, "
");
if(PlayerInfo[i][pAP] >= 1) strcat(info, " [AP]");
if(PlayerInfo[i][pSecurity] >= 1) strcat(info, " [Sec]");
SendClientMessage(playerid, GetPVarInt(i, "AdminDuty") == 1? COLOR_GREEN : COLOR_GREY, info);
}
}
return 1;
}