/admins not working rightly
#1

Код:
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
Reply
#2

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.
Reply
#3

Thanks you very much .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)