Giter Site home page Giter Site logo

v-cargens's Introduction

v-cargens

Car generator information from GTA V which you can use as vehicle spawn locations in alternative multiplayer mods, currently providing 9984 coordinates.

NoZoneVehicles Version

This JSON file contains car generator coordinates and models Rockstar specified in YMAP files. Only 1121 coordinates have pre-defined vehicle models, you can either keep them or ignore them and spawn your own vehicles.

ZoneVehicles Version

In addition to NoZoneVehicles data, this JSON file has vehicle models that have a chance to spawn at the coordinates. In this version 9942 coordinates have pre-defined vehicle models. (Generated from popcycle.dat)

Example Car Generator

{
  "x": -1595.1792,
  "y": -3170.36426,
  "z": 12.854578,
  "heading": -208.770676,
  "models": [
    "airbus",
    "rentalbus"
  ]
}

Usage (RAGEMP JS)

const data = require("./CarGens_ZoneVehicles");

let count = 0;
for (let i = 0; i < data.length; i++) {
    if (data[i].models.length === 0) {
        continue;
    }

    // No checks for boats etc. - might cause weird spawns
    mp.vehicles.new(data[i].models[ Math.floor(Math.random() * data[i].models.length) ], new mp.Vector3(data[i].x, data[i].y, data[i].z), {
        heading: data[i].heading
    });

    count++;
}

console.log(`Created ${count} vehicles.`);

Notes

  • Big credits to the CodeWalker project & contributors, without them this wouldn't be possible.

  • Even though there are 9000+ coordinates available, it doesn't mean you should spawn vehicles on all coordinates. Personally, using 20-30% of the locations is more than enough.

  • ZoneVehicles version didn't had any checks while generating, so car generators at land (like a car park) might have a boat as one of the vehicle models. This might change in the future but no promises.

  • Some vehicles might spawn in air, in that case try using SET_VEHICLE_ON_GROUND_PROPERLY native.

v-cargens's People

Contributors

root-cause avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.