[HELP]Cmd..
#1

What we do wrong?

Код:
YCMD:admins(playerid, params[], help)
{
    #pragma unused params
	#pragma unused help
    new pname[24], admincount = 0;
    SendClientMessage(playerid, 0x00D90044, "--------------");
    SendClientMessage(playerid, 0x00D90044, "Admins Online:");

    for (new i = 0; i < GetMaxPlayers(); i++)
	{
    if (IsPlayerConnected(i) && (pInfo[playerid][pAdmin] == 0))
	{
    admincount ++;
    GetPlayerName(i, pname, 24);
    SendClientMessage(playerid, 0x00D90044, pname);
    }
    }
    
    if (!admincount) SendClientMessage(playerid, 0x00D90044, "No admins");
    SendClientMessage(playerid, 0x00D90044, "--------------");
	return 1;
}
Reply
#2

What's the problem ? Errors, or something like it?

Okay.. what the hell, you check if the player is NOT an admin then you add him to the list?
pawn Код:
if (IsPlayerConnected(i) && (pInfo[playerid][pAdmin] == 0))
REPLACE TO

pawn Код:
if (IsPlayerConnected(i) && (pInfo[playerid][pAdmin] > 0))
Reply
#3

if more want to see id?
Reply
#4

If you mean playerID you must create an format then.
like this:
pawn Код:
new adminn[64];
format(adminn,sizeof(adminn),"[ID: %d] %s",i,pname);
SendClientMessage(playerid, 0x00D90044, adminn);
replace the 3 lines with your line of SendClientMessage.
Reply
#5

dosent apperar...
Reply
#6

had a little mistake in my post, fixed it.
Reply
#7

one last question, if I want to do dialog? and the level you see?
Reply
#8

pawn Код:
YCMD:admins(playerid, params[], help)
{
    #pragma unused params
    #pragma unused help
    new pname[24], admincount = 0;
    for (new i = 0; i < GetMaxPlayers(); i++)
    {
    if (IsPlayerConnected(i) && (pInfo[i][pAdmin] > 0))
    {
    admincount ++;
    GetPlayerName(i, pname, 24);
    format(string,sizeof(string),"%s [ID : %d] | Level : %d\n",pname,i,pInfo[i][pAdmin]);
    }
    ShowPlayerDialog(playerid,DIALOG_STYLE_MSGBOX,9999,"Admins online",string,"Close","");
    }
   
    if (!admincount) ShowPlayerDialog(playerid,DIALOG_STYLE_MSGBOX,"Admins online","There are no admins online.","Close","");
    SendClientMessage(playerid, 0x00D90044, "--------------");
    return 1;
}
Reply
#9

lol, wtf ?

Reply
#10

Making admins list into dialog is very complicated.
I suggest you to stay with the text type of /admins.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)