Quote:
Originally Posted by Jonny5
you dont need a 2d array for this,
the reason the wiki using one is each row is storing 3 values...
so code like this should work,
pawn Код:
new RandomVehicles[] = { 404, 401, 405 };
new rand = random(sizeof(RandomVehicles)); AddStaticVehicleEx(RandomVehicles[rand],-901.9831,2687.4890,42.4714,43.9074,-1,0,60000); // RandCar1 random(sizeof(RandomVehicles)); AddStaticVehicleEx(RandomVehicles[rand],-901.9831,2687.4890,42.4714,43.9074,-1,0,60000); // RandCar2 random(sizeof(RandomVehicles)); AddStaticVehicleEx(RandomVehicles[rand],-901.9831,2687.4890,42.4714,43.9074,-1,0,60000); // RandCar3
it wont seam very random with just 3 values however
there is a 33.333333333% chance that each car will be called
hope this helps,
|
Thank you for your reply, but it's only spawning a Perrenial (404). To test if it was really outputting a random vehicle ID, I made a /respawncars command to see if it would change. But it still keeps spawning a Perrenial.