ShowPlayerDialog
#2

You should create an array that includes the positions of the locations you want to be shown in the dialog.
Then you need a function to get the distance between to points (https://sampwiki.blast.hk/wiki/GetPlayerDistanceFromPoint).

You can set a loop that is running through your array and is getting the distance to each point.
e.g.
Код:
enum locData
{
	posName[20],
	Float:posX,
	Float:posY,
	Float:posZ
}
new YourList[][locData] =
{
	{"SomeName", 0.0, 0.0, 0.0},
	{"Someother", 123.512, 1252.123, 12.00}
};


//The following code inside your function, command or whatever
new Float:dist, string[500];
for(new n=0; n<sizeof(YourList); n++)
{
	dist = GetPlayerDistanceFromPoint(playerid, YourList[n][posX], YourList[n][posY], YourList[n][posZ]);
	if(n == 0)
		format(string, sizeof(string), "%s - %02f", YourList[n][posName], dist);
	else
		format(string, sizeof(string), "%s\n%s - %02f", string, YourList[n][posName], dist);
}
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Distances", string, "Ok", "");
Reply


Messages In This Thread
ShowPlayerDialog - by Ugaustin - 07.02.2016, 12:34
Re: ShowPlayerDialog - by Sascha - 07.02.2016, 12:42
Re: ShowPlayerDialog - by Ugaustin - 07.02.2016, 12:53
Re: ShowPlayerDialog - by Ugaustin - 07.02.2016, 13:24

Forum Jump:


Users browsing this thread: 1 Guest(s)