SA-MP Forums Archive
admins dialog - 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 dialog (/showthread.php?tid=260223)



admins dialog - kvsolga - 07.06.2011

can someone please help me make a /admins command but in dialog form i can onlly make it without dialog i want it to look like this , thx:


Hope you can help me make this


Re: admins dialog - Haydz - 07.06.2011

pawn Код:
command(admins,playerid,params[]) //You can change to strcmp or w/e
{
       //You may need to make the longstring longer depending on how many admins you have which are usually online,
    new longstring[200],shortstring[30],Count = 0,pName[25];
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerAdmin(i)) //Change this to your admin rank.
        {
            Count++;
            GetPlayerName(i,pName,25);
            format(shortstring,sizeof(shortstring),"\n%s",pName); //You could also add some more things in like there admin level. But remember to make the string length longer!
            strcat(longstring,shortstring);
        }
    }
    format(shortstring,sizeof(shortstring),"%d admins online",Count);
    ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX,"Online Admins",longstring,"Ok","");
        //Change the dialogid to a number, make sure there are no dialog id's with the same number.
    return 1;
}
Hopefully something like this should work, I didn't test it but it will give you a fair idea on how it works.

Goodluck!


Re: admins dialog - MBX97 - 08.06.2011

COOOOOOOOOOOOOOOOOOOOOOOOL


Re: admins dialog - kvsolga - 08.06.2011

ye but how could I be able to change this:
Код:
	if (strcmp(cmd, "/admins", true) == 0)
	{
     	SendClientMessage(playerid, COLOR_LIGHTBLUE, "Admins Online:");
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(IsPlayerConnected(i))
			{
			    if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 11)
			    {
					GetPlayerName(i, sendername, sizeof(sendername));
					format(string, 256, "%s | Level: %d", sendername, PlayerInfo[i][pAdmin]);
     				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
				}
			}
		}
		return 1;
	}
into the dialog above


Re: admins dialog - kvsolga - 08.06.2011

soz for double post but any help?