SA-MP Forums Archive
Dialog doesnt show full members - 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: Dialog doesnt show full members (/showthread.php?tid=620306)



Dialog doesnt show full members - ThatFag - 28.10.2016

hello.
i was trying to convert from message to the dialog now the problem is that the dialog shows only 1 name and no what is meant to show the whole list of members.
it is suppost to show for example
ThatFag - Tier(online) if he is online
ThatFag - tier - if he is not online there will be no online tag

codes.
Код:
function:ShowAllMembers(playerid)
{
	new rows, fields;
	cache_get_data(rows, fields, MySQLPipeline);
	if(rows)
	{
		for(new row = 0; row < rows; row++) //magic is happening!
		{
			new iMessage[MAX_STRING], iFormat[45], iGet[75], pName[MAX_PLAYER_NAME],wazzap[30];
			if(IsPlayerConnected(GetPlayerId(pName)))
			{
			myStrcpy(wazzap,"(Online)");
			}

			cache_get_field_content(row, "PlayerName", pName, MySQLPipeline); // player is connected, skip it!
			format(iFormat, sizeof(iFormat), " - %s", pName); strcat(iMessage, iFormat);
			cache_get_field_content(row, "Tier", iGet, MySQLPipeline);
			format(iFormat, sizeof(iFormat), "{6D81E5}(Tier: %d){17A501}%s\n%s",strval(iGet),wazzap,iFormat); strcat(iMessage, iFormat);
			SendClientMessage(playerid, COLOR_GREY, iMessage);
			ShowPlayerDialog(playerid,800,DIALOG_STYLE_LIST,"Members",iMessage,"Okay","");
		}
	}
	return 1;
}



Re: Dialog doesnt show full members - AndySedeyn - 28.10.2016

Here's some advice: