SA-MP Forums Archive
[HELP]Cmd.. - 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: [HELP]Cmd.. (/showthread.php?tid=285494)



[HELP]Cmd.. - TheBluec0de - 24.09.2011

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;
}



Re: [HELP]Cmd.. - CmZxC - 24.09.2011

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))



Re: [HELP]Cmd.. - TheBluec0de - 24.09.2011

if more want to see id?


Re: [HELP]Cmd.. - CmZxC - 24.09.2011

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.


Re: [HELP]Cmd.. - TheBluec0de - 24.09.2011

dosent apperar...


Re: [HELP]Cmd.. - CmZxC - 24.09.2011

had a little mistake in my post, fixed it.


Re: [HELP]Cmd.. - TheBluec0de - 24.09.2011

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


Re: [HELP]Cmd.. - CmZxC - 24.09.2011

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;
}



Re: [HELP]Cmd.. - TheBluec0de - 24.09.2011

lol, wtf ?




Re: [HELP]Cmd.. - CmZxC - 24.09.2011

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