Jump to content

Spawning Other Items/Peds/Vehicles A Bit Away From The Main Spawn


Recommended Posts

So heres what im trying to do:

Spawn a single vehicle, then spawn another vehicle a very small distance away from it but still around it but i cant really think of a simple and portable way to do it. Please leave some suggestions 🙂 Also if possible could someone also help with making a ped stay inside a vehicle and keep the vehicle parked.

Edited by BloodyMustache89
Link to comment
Share on other sites

  • 2 weeks later...
var firstVehicle = new Vehicle(World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(50f)));
            var secondVehicle = new Vehicle(World.GetNextPositionOnStreet(firstVehicle.Position.Around(10f)));
            
            var driver = new Ped(Vector3.Zero, 0f);
            if (driver && firstVehicle)
            {
                driver.WarpIntoVehicle(firstVehicle, -1);
            }
//simple way of doing it, if the driver is leaving his vehicle, you are probably tasking him to do something else or he was dismissed

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...