02.03.2014, 04:44
pawn Код:
new Float:rSpawns[][] =
{
{3878.7217,466.0317,7.4426}, // array ID 0
{3726.5127,263.8537,7.4798}, // array ID 1
{3695.7917,421.2384,7.4630}, // array ID 2
{3640.9050,344.2969,7.4534}, // array ID 3
{3967.2261,423.8549,28.4928}, // array ID 4
{3928.4590,301.3971,38.8480} // array ID 5
};
public OnGameModeInit()
{
for(new i = 0, iRandom; i < 6; i++) make a loop that auto-adds +1 to i each time a new pickup is made; limit the amount of pickups to 6 via i < 6; change 6 to increase the amount of pickups
{
iRandom = random(sizeof(rSpawns)); // pick a random data set ID from rSpawns
CreatePickup(-1, -1, rSpawns[iRandom][0], rSpawns[iRandom][1], rSpawns[iRandom][2], -1);
}
return 1;
}
So, doing rSpawns[0] will give you this set of data: 3878.7217,466.0317,7.4426
Then, doing rSpawns[0][0] will give you this piece of the set: 3878.7217
Just like doing rSpawns[0][2] will give you this piece: 7.4426