Giter Site home page Giter Site logo

vehiclespawnmenu's Introduction

VehicleSpawnMenu

VehicleSpawnMenu is a resource for FiveM by Albo1125 that provides vehicle spawn menu functionality. It is available at https://github.com/Albo1125/VehicleSpawnMenu

Installation & Usage

  1. Download the latest release.
  2. Unzip the VehicleSpawnMenu folder into your resources folder on your FiveM server.
  3. Add the following to your server.cfg file:
ensure VehicleSpawnMenu
  1. Optionally, create a file called vehicles.json and save your menu setup to it. See Customising your vehicles for further guidance.
  2. Optionally, customise the command in sv_VehicleSpawnMenu.lua.

Commands & Controls

  • /vs - Opens the VehicleSpawnMenu.

Customising your vehicles

You have two options for loading your VehicleSpawnMenu.

  • Firstly, you can add a vehicles.json file. If this file is created inside the resource folder, it will always be used.
  • Secondly, you can load your vehicles.json contents dynamically. If no vehicles.json file is present in the resource folder, the client will trigger a server event VehicleSpawnMenu:RequestCategoriesJsonString() when they use the /vs command. The client will then listen for a VehicleSpawnMenu:CategoriesJsonString(jsonString) event from the server. jsonString should be a valid JSON string in the vehicles.json format.

You can add as many SubCategories and VehicleSpawns to the root array as you like. An example vehicles.example.json file is included. JSON reference is as follows.

SubCategory

  • "Name" string indicating the (unique?) name of this SubCategory
  • A "SubCategories" and/or "VehicleSpawns" array containing further SubCategory or VehicleSpawn entries.

VehicleSpawn

If this is selected, a vehicle will be spawned with the appropriate properties. The spawning client will also trigger a server event as follows: VehicleSpawnMenu:VehicleSpawned(Name, VehicleModelName, Plate).

  • "Name" string indicating the display name of this VehicleSpawn
  • "VehicleModelName" is the ingame model name/spawncode of this vehicle
  • "Plate" the plate to set on this vehicle when it is spawned
  • "LiveryNumber" optional number representing which livery to set on the vehicle when it is spawned.

Improvements & Licencing

Please view the license. Improvements and new feature additions are very welcome, please feel free to create a pull request. As a guideline, please do not release separate versions with minor modifications, but contribute to this repository directly. However, if you really do wish to release modified versions of my work, proper credit is always required and you should always link back to this original source and respect the licence.

Libraries used (many thanks to their authors)

vehiclespawnmenu's People

Contributors

albo1125 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.