Random Mis
#8

Quote:
Originally Posted by KamilPolska
Посмотреть сообщение
I do not know how to do it exactly.
https://pastebin.com/i07Wqm3X
Well sorry for making you misunderstood. I didn't ask you to reduce your array until 5, you can keep it like before (10). I mean you can use it like this:
Код:
CMD:z(playerid, params[])
{
	if(MissionStatus[playerid] == 0)
	{
		new LoadText[1000]; // dialog text buffer
		LoadText = "Commadity\tPoint\tPrize"; // the dialog headers
		ShuffleDeepArray(MisLocations); // random the order of array
		for (new i = 0; i < 5; i++) // pick only first 5 missions randomly
		{
			format(LoadText, 1000, "%s\n{008000}%s\t{FFFF00}%s\t{FF0000}%d $", LoadText, MisLocations[i][Commadity], MisLocations[i][LoadName], MisLocations[i][Pay]);
		}
		ShowPlayerDialog(playerid, DIALOG_MISSION, DIALOG_STYLE_TABLIST_HEADERS, "MISSION", LoadText, "OK", "Cancel");
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, "/cancel !");
	}
	return 1;
}
Then you can add more missions on MisLocations array, just make sure it has more than 5 items otherwise it would be useless to shuffle (would not work if less!). Everytime the player type the command, they will always get different 5 random missions. On the dialog response, get the inputtext to get the selected mission ID. You might get "{008000}1" where 1 is mission id and {008000} is the color embedding, you could delete the color embedding by deleting first 8 characters in string or just remove your color embedding code at the dialog command.

Hope that helps.
Reply


Messages In This Thread
Random Mis - by KamilPolska - 12.05.2018, 14:15
Re: Random Mis - by TadePoleMG - 12.05.2018, 14:51
Re: Random Mis - by KamilPolska - 12.05.2018, 14:59
Re: Random Mis - by KamilPolska - 13.05.2018, 11:47
Re: Random Mis - by RoboN1X - 13.05.2018, 12:59
Re: Random Mis - by KamilPolska - 13.05.2018, 13:46
Re: Random Mis - by TadePoleMG - 14.05.2018, 08:07
Re: Random Mis - by RoboN1X - 14.05.2018, 12:22
Re: Random Mis - by KamilPolska - 14.05.2018, 17:59

Forum Jump:


Users browsing this thread: 1 Guest(s)