SA-MP Forums Archive
Random Vehicle Spawn - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random Vehicle Spawn (/showthread.php?tid=197712)



Random Vehicle Spawn - barneystinson - 10.12.2010

Hey guys

Is it possible to set random vehicle spawns for "CreateVehicle" as i done a car shop but its kinda useless if all cars spawn on top of each other.

I done it in a dialog based system but i attempted using

Quote:

new PoliceVeh = random(6);
switch (PoliceVeh)
{

case 0:

{
PoliceVeh[playerid] = CreateVehicle(523,-1581.8171,651.2495,6.9569,0.2016, -1, -1, -1);
PutPlayerInVehicle(playerid,RandomVeh(playerid), 0);
}

case 1:

{
PoliceVeh[playerid] = CreateVehicle(523,-1587.6960,651.1417,6.9563,359.9494, -1, -1, -1);
PutPlayerInVehicle(playerid,RandomVeh(playerid), 0);
}

case 2:

{
PoliceVeh[playerid] = CreateVehicle(523,-1594.2667,674.4127,6.9565,180.4530, -1, -1, -1);
PutPlayerInVehicle(playerid,RandomVeh(playerid), 0);
}....

Just got a load of errors anyone wanna help ?


Re: Random Vehicle Spawn - XePloiT - 10.12.2010

pawn Код:
new PoliceVeh[MAX_PLAYERS] = random(6);
switch (PoliceVeh[playerid])
try to change the 2 first lines to this... ^