How to set model of car?
-
How do I set the car model in C#?
-
Many different ways.
Vehicle vehicle1 = World.CreateVehicle("911turbos", PP.Position + PP.ForwardVector * 3.0f, PP.Heading + 90); }
-
How would I change an already existing eon?
-
I'm not sure what you mean, an ambient car?
You would have to specify the model and then identify cars with that model within a certain range of the player.
Why would you want to that? Is the vehicle in a fixed position? Unfortunately cars don't have a unique ID that would allow you to identify their location in view of replacement. I'm not talking hash or model id's, I'm talking about the blue 1982 car parked at x,y,z.
-
I mean, if I have a car in a variable, how can I set its model
-
Exactly like above except you create a variable
Something like this, sorry not at my computer.
var MyCar = "eon"; Vehicle MyVehicle = World.CreateVehicle(MyCar, PP.Position + PP.ForwardVector * 3.0f, PP.Heading + 90);
Now if you're taking about changing the model of the car after it has been spawned, I don't know how that would be done without deleting the first instance. This can be easily done with peds, but don't know how it would be done with a car.