01.04.2012, 17:08
hi,
im using this code to spawn 5 pickups and random defined spawnpoints but sometimes it happens that there are 2 or even 3 pickups spawned at the same place.
How would i prevent that?
How can i make it like only 1 pickup can be spawned at a place?
+rep for help![Smiley](images/smilies/smile.png)
im using this code to spawn 5 pickups and random defined spawnpoints but sometimes it happens that there are 2 or even 3 pickups spawned at the same place.
How would i prevent that?
How can i make it like only 1 pickup can be spawned at a place?
+rep for help
![Smiley](images/smilies/smile.png)
pawn Код:
new Float:MoneyRushPoints[60][5] = //spawnpoints
{
{-1633.6028,-2244.1521,31.4766},
{-1635.2443,-1935.8237,115.1392},
{-1335.9425,-2248.6763,32.5839},
{-1845.4031,-1709.8015,41.1106},
{-1820.0410,-1608.4302,23.0156},
{-1982.5382,-2120.4873,74.5776},
{-2089.5581,-2346.9045,30.6250},
//etc.
};
new RRush = random(sizeof(MoneyRushPoints));
DynPickup[2] = CreateDynamicPickup(1550,2,MoneyRushPoints[RRush][0],MoneyRushPoints[RRush][1],MoneyRushPoints[RRush][2],0);
for(new i; i < 1; i++)
{
RRush = random(sizeof(MoneyRushPoints));
PickUpDrugOnMr[1] = CreateDynamicPickup(1241,3,MoneyRushPoints[RRush][0],MoneyRushPoints[RRush][1],MoneyRushPoints[RRush][2],0);
RRush = random(sizeof(MoneyRushPoints));
PickUpDrugOnMr[2] = CreateDynamicPickup(1241,3,MoneyRushPoints[RRush][0],MoneyRushPoints[RRush][1],MoneyRushPoints[RRush][2],0);
RRush = random(sizeof(MoneyRushPoints));
PickUpDrugOnMr[3] = CreateDynamicPickup(1241,3,MoneyRushPoints[RRush][0],MoneyRushPoints[RRush][1],MoneyRushPoints[RRush][2],0);
RRush = random(sizeof(MoneyRushPoints));
PickUpDrugOnMr[4] = CreateDynamicPickup(1241,3,MoneyRushPoints[RRush][0],MoneyRushPoints[RRush][1],MoneyRushPoints[RRush][2],0);
RRush = random(sizeof(MoneyRushPoints));
PickUpDrugOnMr[5] = CreateDynamicPickup(1241,3,MoneyRushPoints[RRush][0],MoneyRushPoints[RRush][1],MoneyRushPoints[RRush][2],0);
}