make this to dialog
#1

Can you please convert this to dialog? I tried but failed. Only good scripter can fix this problem. thanks waiting for your reply.

Код HTML:
COMMAND:admins(playerid,params[])
{
    #pragma unused params
    SendClientMessage(playerid, PURPLE, "--------------------------------------");

	new Count[2], i, string[128];
	for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
	{
		if(PlayerInfo[i][AdminLevel] > 0) Count[0]++;
		if(IsPlayerAdmin(i)) Count[1]++;
	}

	if((Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][AdminLevel] == 0))
	{
		SendClientMessage(playerid, PURPLE, "No Administrators online");
		SendClientMessage(playerid, PURPLE, "--------------------------------------");
		return 1;
	}

	if(Count[0] == 1)
	{
	    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0)
		{
			format(string, sizeof(string), "Admin: (%d)%s [AdminLevel: %d]", i, GetName(i), PlayerInfo[i][AdminLevel] ); SendClientMessage(playerid, BLUE, string);
		}
	}

 	if(Count[0] > 1)
	 {
	    new x; format(string, sizeof(string), "Admins:");
	    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][AdminLevel] > 0)
		{
			format(string,sizeof(string),"%s(%d)%s [AdminLevel: %d]",string,i,GetName(i),PlayerInfo[i][AdminLevel]);
			x++;
			if(x >= 5)
			{
			    SendClientMessage(playerid, PURPLE, string); format(string, sizeof(string), "Admins: "); x = 0;
			}
			else format(string, sizeof(string), "%s,  ", string);
	    }
		if(x <= 4 && x > 0) {
			string[strlen(string)-3] = '.';
		    SendClientMessage(playerid, PURPLE, string);
		}
	}

	if( (Count[1] == 1) && (PlayerInfo[playerid][AdminLevel] > 0))
	{
	    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
		{
			format(string, sizeof(string), "RCON Admin: (%d)%s", i, GetName(i));
			SendClientMessage(playerid, GREEN, string);
		}
	}
	if(Count[1] > 1)
	{
 		new x; format(string, sizeof(string), "RCON Admins: ");
	    for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
		{
			format(string,sizeof(string),"%s(%d)%s",string,i,GetName(i));
			x++;
			if(x >= 5)
			{
				SendClientMessage(playerid, WHITE, string); format(string, sizeof(string), "RCON Admins: "); x = 0;
			}
			else format(string, sizeof(string), "%s,  ", string);
	    }
		if(x <= 4 && x > 0)
		{
			string[strlen(string)-3] = '.';
		    SendClientMessage(playerid, GREEN, string);
		}
	}

	SendClientMessage(playerid, PURPLE, "--------------------------------------");
	return 1;
}
Reply


Messages In This Thread
make this to dialog - by kbalor - 09.11.2013, 10:14
Re: make this to dialog - by Loot - 09.11.2013, 11:56
AW: make this to dialog - by Nero_3D - 09.11.2013, 12:40

Forum Jump:


Users browsing this thread: 1 Guest(s)