Coder Social home page Coder Social logo

mirrox1337 / enc0ded-persistent-vehicles Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enc0ded/enc0ded-persistent-vehicles

0.0 0.0 0.0 69 KB

Mod for FiveM OneSync Multiplayer servers

Home Page: https://discord.gg/wNChXdB

License: MIT License

Lua 100.00%

enc0ded-persistent-vehicles's Introduction

enc0ded-persistent-vehicles

This mod prevents vehicles from disappearing in OneSync multiplayer servers. It can also respawn vehicles in their previous location after a server restart.

Requirements

FiveM Version >=2443 OneSync - This mod will not work without OneSync.

Installation

Download or clone from repo. Place the enc0ded-persistent-vehicles folder in your resources folder. Open config.lua and configure to your needs. Start the resource.

start enc0ded-persistent-vehicles

Usage

To make a vehicle persistent, pass its entity to the event below in a client script. For example if you are using ESX you can put this in the call back of the ESX.Game.SpawnVehicle function.

  # client event
  TriggerEvent('persistent-vehicles/register-vehicle', entity)

To update a persistent vehicle, pass its entity to the event below in a client script. For example if you are using ESX you can put this in the call back of the ESX.Game.SetVehicleProperties function.

  # client event
 TriggerEvent('persistent-vehicles/update-vehicle', entity)

Stop a vehicle from being persistent and allow it to be removed as normal. Does not delete the vehicle. Call this when a player puts away a vehicle. Also remember to call this on your admin delete vehicle commands.

  # client event
  TriggerEvent('persistent-vehicles/forget-vehicle', entity)

If you enable repopulate on reboot then you need to call the server event below before your server shuts down. This will ensure that the vehicles spawn in the exact same location when the server comes back online.

# server event
TriggerEvent('persistent-vehicles/save-vehicles-to-file')

Alternatively you can stop the resource which will do this automatically.

# server event
StopResource('enc0ded-persistent-vehicles')

Server Console Commands

Cull persistent vehicles

pv-cull <number of vehicles>

Unpersist vehicles

pv-forget-all

Get number of vehicles spawned on the map

pv-num-spawned

Get number of vehicles registered as persistent

pv-num-registered

Toggle console debugging messages

pv-toggle-debugging

Save all persistent vehicles to file. Can be called before reboot.

pv-save-to-file

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Support

Discord

License

MIT

enc0ded-persistent-vehicles's People

Contributors

enc0ded avatar ffrankys avatar hatchett avatar josh-tf avatar knaak53 avatar thisneq 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.