SA-MP Forums Archive
Array problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Array problem (/showthread.php?tid=264508)



Array problem - Ryso - 26.06.2011

Код:
#define PICKUPS_NUMBER 5
#define MAX_LS_LOCATIONS 60
new LSObjectLocationsPickUp[MAX_PLAYERS_VAR][PICKUPS_NUMBER];

new Float:LSObjectLocations[MAX_LS_LOCATIONS][3] = {
	{2689.9155,-1698.7030,9.9737},
	{2218.4771,-1164.4073,25.2973},
...
	{2245.4922,-1318.1755,23.9844}
}
I have array like this with 60 different locations.

How can I create a function, that randomly chooses only 5 out of those 60 locations without repeating any on them and then create pickups on those 5 locations?