Random cars at a certain position
#1

How do I make the server spawn a random cars at a certain position? please post the thing down here, thank you

also I dont want some cars like Hunter and planes and monster to be spawned at that position.
Reply
#2

Any help?
Reply
#3

Help?!
Reply
#4

I Think Someone Post The Same Topic With You In This Forum,
So Just Find It

Sorry Cause I Cant Help You Cause Im New In Pawno
Reply
#5

Make an array of random car IDs..like this
pawn Код:
new randomcars[]=
{
     461,
     521,
     561
//Add more vehicle IDs here
};
Then in your OnGameModeInIt,

pawn Код:
AddStaticVehicle(random(sizeof(randomcars)), X pos,Y pos,Z pos, Float:angle, color1, color2)
Reply
#6

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
Make an array of random car IDs..like this
pawn Код:
new randomcars[]=
{
     461,
     521,
     561
//Add more vehicle IDs here
};
Then in your OnGameModeInIt,

pawn Код:
AddStaticVehicle(random(sizeof(randomcars)), X pos,Y pos,Z pos, Float:angle, color1, color2)
Not quite.

The definition of the array is used correctly, but when you're going to use it in the function you need to do this:
pawn Код:
randomcars[ random( sizeof( randomcars ))]
, else you're just generating a random number between 1 (or is it 0?) and 3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)