15.08.2012, 22:52
i want to make a /admins command so it displays all online admins in a dialog? any help?
dcmd_admins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new ChangeColor;
SendClientMessage(playerid, white, " ");
SendClientMessage(playerid, white, "Admins Online");
SendClientMessage(playerid, white, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
{
if(AccInfo[i][Level] > 5)
{
AdmRank = "Level 7";
ChangeColor = Color_Level_7;
}
if(IsPlayerAdmin(i))
{
AdmRank = "RCON Administrator";
ChangeColor = Color_RCON_Administrator;
}
else
{
switch(AccInfo[i][Level])
{
case 1: {
AdmRank = "Level1";
ChangeColor = Color_Level_1;
case 2: {
AdmRank = "Level2";
ChangeColor = Color_Level_2;
}
case 3: {
AdmRank = "Level3";
ChangeColor = Color_Level_3;
}
case 4: {
AdmRank = "Level4 ";
ChangeColor = Color_Level_4;
}
case 5: {
AdmRank = "Level5";
ChangeColor = Color_Level_5;
}
}
}
switch(AccInfo[i][OnDuty])
{
case 0: AdmDuty = "Playing!";
case 1: AdmDuty = "On Duty!";
}
format(string, 128, "Level: %d - %s (Id:%i) | %s | %s",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
SendClientMessage(playerid, ChangeColor, string);
count++;
}
}
}
if (count == 0)
SendClientMessage(playerid,white,"No admin online in the list");
return 1;
}
Example!
pawn Code:
But you can gather them and make it work! |