SA-MP Forums Archive
/admins not working rightly - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /admins not working rightly (/showthread.php?tid=178477)



/admins not working rightly - Tekto - 22.09.2010

Код:
COMMAND:admins(playerid, params[])
{
    new admin = 0;
    foreach(petla, i)
    {
	if(PlayerInfo[i][pAdmin] >= 1)
	{
	format(str,sizeof(str),"%s | Admin Level: %d \n", NickName(i), PlayerInfo[i][pAdmin]);
	admin++;
	}
    }
    if(admin >= 1)
    {
	ShowPlayerDialog(playerid, 11, DIALOG_STYLE_LIST, "Online Admins", str, "Okey", "Close");
    }
    if(admin == 0)
    {
	ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Administrators", "Server: No Administrators Online", "Okey", "Cancel");
    }
	return true;
}
So , im one admin online, then it shows me,
But if an another admin joins ( 2 admins online now ) Then it will show only that admin who joined lately ( Another admin )

Whats the problem ? Im getting no errors


Re: /admins not working rightly - Hiddos - 22.09.2010

pawn Код:
COMMAND:admins(playerid, params[])
{
    new admin = 0;
    strdel(str, 0, sizeof str -1);
    foreach(petla, i)
    {
    if(PlayerInfo[i][pAdmin] >= 1)
    {
    format(str,sizeof(str),"%s%s | Admin Level: %d \n", str, NickName(i), PlayerInfo[i][pAdmin]);
    admin++;
    }
    }
    if(admin >= 1)
    {
    ShowPlayerDialog(playerid, 11, DIALOG_STYLE_LIST, "Online Admins", str, "Okey", "Close");
    }
    if(admin == 0)
    {
    ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "Administrators", "Server: No Administrators Online", "Okey", "Cancel");
    }
    return true;
}
Should work.


Re: /admins not working rightly - Tekto - 22.09.2010

Thanks you very much .