Random vehicle
#3

Quote:
Originally Posted by Dokins
Посмотреть сообщение
Two things:
Where are you creating the vehicle?
Also, I'm not sure if you can use random like that in the function.

try something like:

pawn Код:
new model, colour1, colour2;
model = random(29);
colour1 = random(127);
colour2 = random(127);

CreateVehicle(RandomFreeVeh[model],1544.7468,-1655.2185,5.5157,263.5304,colour1, colour2, 10*60000);
Yes, you can use random in functions... Therefore, your code is the exact same as his and there is no point in changing his to yours.

About it not spawning, try debugging it.

pawn Код:
printf("Vehicle ID: %i, %i, %i", CreateVehicle(RandomFreeVeh[random(29)],1544.7468,-1655.2185,5.5157,263.5304,random(127), random(127), 10*60000), CreateVehicle(RandomFreeVeh[random(29)],1544.7468,-1655.2185,5.5157,263.5304,random(127), random(127), 10*60000), CreateVehicle(RandomFreeVeh[random(29)],1544.7468,-1655.2185,5.5157,263.5304,random(127), random(127), 10*60000));
That should create three vehicles, thus printing three different ID's.
Reply


Messages In This Thread
Random vehicle - by cnoopers - 08.08.2015, 21:36
Re: Random vehicle - by Dokins - 08.08.2015, 22:09
Re: Random vehicle - by Crayder - 08.08.2015, 22:32
Re: Random vehicle - by Dokins - 08.08.2015, 22:46
Re: Random vehicle - by cnoopers - 08.08.2015, 22:54
Re: Random vehicle - by MarvinPWN - 09.08.2015, 08:40
Re: Random vehicle - by Crayder - 09.08.2015, 08:54

Forum Jump:


Users browsing this thread: 1 Guest(s)