Giter Site home page Giter Site logo

demi-pedmanager's Introduction

Demi Ped Manager

A FiveM script to spawn, animate, and manage NPCs in your GTA V server.

Features

With this script, you can:

  • Spawn NPC characters (Peds) with specific models at designated coordinates.
  • Assign custom scenarios, animations, and props to the Peds.
  • Setup custom event targets for the Peds.
  • Handle spawning and despawning of Peds with custom callbacks.
  • Despawn the Peds when the player is not in their vicinity to save resources.

Usage

This script uses the peds table to define the NPC entities. Each entry in the table corresponds to a single Ped and their respective configurations.

Here's an example of a Ped configuration:

{
    model = "s_f_y_airhostess_01",
    coords = vec4(3.1629, -1309.7675, 30.1646, 7.2837),
    renderDistance = 30.0,
    animation = {
        dict = "amb@code_human_in_bus_passenger_idles@female@tablet@idle_a",
        anim = "idle_a",
        flag = 63
    },
    prop = {
        propModel = "prop_cs_tablet",
        bone = 28422,
        rotation = vec3(0.0, 0.0, 0.03),
        offset = vec3(0.0, 0.0, 0.03),
    },
    targetOptions = {
        {
            icon = 'fas fa-money-bill-alt',
            label = 'something',
            serverEvent = "some event"
        },
    },
    onSpawn = function(ped, pedData) -- Callback function after the Ped is spawned
        print(("ped handle is %s"):format(ped))
        print(json.encode(pedData, { indent = true }))
    end,
    onDespawn = function(ped, pedData) -- Callback function before the Ped is despawned
        print(("ped handle is %s"):format(ped))
        print(json.encode(pedData, { indent = true }))
    end
}

Dependencies

This script requires the following resources to work correctly:

Make sure you have these installed and properly working in your server before installing this script.

Installation

To install this script, please follow the steps below:

  1. Download the script file.
  2. Place the downloaded file into your server's resources directory.
  3. Open your server configuration file (server.cfg).
  4. Add the following line to the server configuration file:
ensure demi-pedmanager

demi-pedmanager's People

Contributors

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