Randomized Pickups that give weapons.
#7

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
Reply


Messages In This Thread
Randomized Pickups that give weapons. - by rangerxxll - 01.03.2014, 06:31
Re: Randomized Pickups that give weapons. - by Crayder - 01.03.2014, 07:09
Re: Randomized Pickups that give weapons. - by rangerxxll - 01.03.2014, 07:12
Re: Randomized Pickups that give weapons. - by Crayder - 01.03.2014, 07:26
Re: Randomized Pickups that give weapons. - by rangerxxll - 01.03.2014, 07:30
Re: Randomized Pickups that give weapons. - by rangerxxll - 02.03.2014, 01:35
Re: Randomized Pickups that give weapons. - by Scenario - 02.03.2014, 04:44
Re: Randomized Pickups that give weapons. - by Crayder - 04.03.2014, 04:55
Re: Randomized Pickups that give weapons. - by rangerxxll - 04.03.2014, 05:02

Forum Jump:


Users browsing this thread: 2 Guest(s)