Giter VIP home page Giter VIP logo

cfx-otonomy-trains's Introduction

FiveM Train Script

Train Management System for FiveM.

Installation

Add line below to your server.cfg

ensure cfx-otonomy-trains

Features

  • Spawn trains at specific locations
  • Synchronize train positions and speeds
  • Delete trains and their blips
  • Display trains on the map with blips

Configuration

Config = {}

-- Trains spawn coordinates
Config.TrainSpawns = {
    { x = 2533.0, y = 2833.0, z = 38.0},
    { x = 2606.0, y = 2927.0, z = 40.0},
    { x = 2463.0, y = 3872.0, z = 38.8},
    { x = 1164.0, y = 6433.0, z = 32.0}
}

-- Train speed
Config.TrainSpeed = 20.0

-- Train blips
Config.TrainBlips = true

Client-Side Events

Event Description
trains:spawn Spawns a train at the specified coordinates.
trains:sync Syncs the train data across all clients.
trains:delete Deletes the specified train.

Server-Side Events

Event Description
trains:update Updates the train data and syncs it across all clients.
trains:playerReady Initializes trains when the first player joins.

Contributing

  • Feel free to contribute as long as you don't break things.

License

This project is licensed under the MIT License.

cfx-otonomy-trains's People

Contributors

reprehenderit avatar

Stargazers

Dave Lowe avatar

Watchers

 avatar

Forkers

kamciogit

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.