Skip to content

KWMSources/ParkedVehicleSpawner

Repository files navigation

Please mention: This project is no longer maintained. It will also not be maintained for money. No matter how much money you offer: I will not help you maintain this project. So please: Don't contact me. Thanks.

ParkedVehicleSpawner

This is a AltV resource to spawn vehicles randomly on the native parking spots of GTA 5.

Installation

  1. Copy the files of this repository into a new folder called "ParkedVehicleSpawner" in your resource folder
  2. Add "ParkedVehicleSpawner" into the resource section of your server.cfg

Usage

  1. Add the following dependency into the resource.cfg in which you want to use the ParkedVehicleSpawner:
deps: [
	"ParkedVehicleSpawner"
]

Usage in NodeJS

  1. Edit the resource.cfg and set the type to js and the main to server/server.js
  2. Import the package by using import * as ParkedVehicleSpawner from "ParkedVehicleSpawner";
  3. Spawn your desired amount of parked vehicled by using ParkedVehicleSpawner.spawn(amount);

Usage in C-Sharp

  1. Use the following code:
{
  public override void OnStart()
  {
    Alt.Import("SetRandomParkedVehicleCount", "SetRandomParkedVehicleCount", out Action<int> SetRandomParkedVehicleCount);
    SetRandomParkedVehicleCount({NumbersOfVehiclesYouWantToSpawn}) //to set an approximately count of vehicle spawns

    Alt.Import("SpawnParkedVehicles", "SpawnParkedVehicles", out Action SpawnParkedVehicles);
    SpawnParkedVehicles() //to spawn the vehicles
  }
}

Change Spawning Data

Look into the four JSONs to change spawning behaviour.

  • CarColorsRGBs.json - Colors in which the cars randomly spawn, format: {r: 0, g: 0, b: 0, a: 1}, set as empty array to let the resource select colors randomly
  • CarGenerators.json - Parking spots on which vehicles can spawn (can also be used for other purposes)
  • PopGroup.json - Some parking spots have a "popGroup" which is a group of vehicles which can be spawned on a specific parking spot. none is the standard popGroup if a CarGenerator spot doesn't have a specific carModel and no popGroup.
  • ColorlessCars.json - Vehicles which will not be colored randomly by this resource

About

AltV resource to spawn vehicles on random parking spots

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •