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



CMD /admins in dialog - ylleron - 04.08.2011

Hi.

I make command /admins, which show player who admins are online. But i have problem in game it show only one line and i don't know how to show all connected admins (ex. 2admins = 2 line).

Код:
YCMD:admins(PARAMS)
{
    #pragma unused help
    #pragma unused params

    // Check if is any Admins online and if is 0 that start this public
	if(AdminsOnline() == 0) return SendMessage(playerid, C_RED, "-error- On the server isn't any admin", "-chyba- Na serveri nieje ziadny Admin");

	// Make string for message
    new str1[180], str[180];

    // And look all players
	loop(i, MAX_PLAYERS)
	{
		if (AdminsOnline() > 0)
		{
		    format(str, sizeof(str), ""TC_RED"%s "TC_WHITE"(Level: %d)\n", GetName(i), GetLevel(i));
		}
		else
		{
		    return Dialog(playerid, D_BASIC, BOX, "Admins online", "No admins online", "OK", "");
		}
	}
	format(str1, sizeof(str1), "%s", str);
	return Dialog(playerid, D_BASIC, BOX, "Admins online", str1, "OK", "");
}



Re: CMD /admins in dialog - Scarred - 04.08.2011

Use strcat.


Re: CMD /admins in dialog - ylleron - 04.08.2011

yes, ok


Re: CMD /admins in dialog - Patchwerk - 14.08.2011

loop(i, MAX_PLAYERS)
{
if (GetLevel(i) > 0)
{
format(str, sizeof(str), ""TC_RED"%s "TC_WHITE"(Level: %d)\n", GetName(i), GetLevel(i));
format(str1,180,"%s%s",str1,str);
}

}
ShowPlayerDialog....,str1,...);