Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by RealCop228
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; }
rSpawns is the name of the array. The [iRandom] is a random ID of the set of data in the array. Each {} encloses a new set of data. Each , inside of a set of data is like a different ID.
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
|
He doesnt want all of them created at the same time... and they need destroyed after being picked up... and as its destroyed a new random one needs to be created... Its the same system used in my old GM Hunger Games... Just dont have access to it yet, or i would've given it to him already