CMD /admins in dialog
#1

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", "");
}
Reply
#2

Use strcat.
Reply
#3

yes, ok
Reply
#4

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,...);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)