[ZCMD]Admin online wrong - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [ZCMD]Admin online wrong (
/showthread.php?tid=502278)
[ZCMD]Admin online wrong -
donhu789 - 23.03.2014
pawn Код:
CMD:admins(playerid, params[])
{
new OnlineAdmins = 0;
new Rank[150];
new adminstringpro[1208];
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][aLevel] >= 5)
{
if(IsAdminUnderCover{i} == true)
{
continue;
}
else
{
switch(PlayerInfo[i][aLevel])
{
case 1:
{
Rank = "No";
}
case 2:
{
Rank = "No";
}
case 3:
{
Rank = "No";
}
case 4:
{
Rank = "No";
}
case 5:
{
Rank = "Moderator";
}
case 6:
{
Rank = "Server Administrator";
}
case 7:
{
Rank = "Trusted Administrator";
}
case 8:
{
Rank = "Server Owner";
}
}
format(adminstringpro, sizeof(adminstringpro),"%s%s - [Level:%d] - [ID:%d] - %s", adminstringpro, GetName(i), PlayerInfo[i][aLevel], i, Rank);
OnlineAdmins++;
}
}
}
}
if(OnlineAdmins == 0)
{
ShowPlayerDialog(playerid, 15321, DIALOG_STYLE_MSGBOX, "NVCNR Admin Online List", "No NVCNR Admin Online In the List\n Admins Are Also watching From console And IRC.", "Okay", "");
}
ShowPlayerDialog(playerid, 15321,DIALOG_STYLE_MSGBOX, "NVCNR Admin Online List", adminstringpro, "ok", "");
new astring[500];
format(astring, sizeof(astring),"%s [%d] typed: /admins", GetName(playerid), playerid);
SendAdminMessage(GREY, astring);
return true;
}
there is 2 admin online but it show only 1 please help
Re: [ZCMD]Admin online wrong -
MP2 - 23.03.2014
Debug messages.
Also, you don't need to use IsPlayerConnected in foreach. The exact purpose of foreach is to only loop through connected players.
Re: [ZCMD]Admin online wrong -
donhu789 - 23.03.2014
so can you help me fix it =.= noob at Scripting for now ;\