Giter Club home page Giter Club logo

hackee-dispatch's Introduction

hackee-dispatch (original forum post)

What is it?

This is a utility that makes creating custom "dispatches" of NPCs a little easier. What is a dispatch you might ask? An example would be the random NPCs that start spawning if you shoot in a gang area (like near grove street): example

The idea is that if you are going to make your own resource involving NPCs, maybe a raid, or maybe just setting up some gang terf, you can use this utility to more easily setup how the NPCs will behave. With this utility, you can now create a custom dispatch consisting of whatever NPCs you want, that get triggered based on whatever you want, with whatever weapons you want, in whatever area you want, etc. You can also make NPCs allies or enemies with players based on the player's job type (ESX)!

When all said and done, your resources should look like this:

ensure hackee-dispatch
ensure my-gangs
ensure my-special-raid
etc.

How do I use it?

First off, it is highly recommended you turn off the existing dispatches prior to using mine (get disabledispatch AND Calm-AI). Next you have two events you can use to control your dispatches:

dispatch:createDispatch

Citizen.CreateThread(function()
	TriggerServerEvent('dispatch:createDispatch', Config)
end)

This event takes a Config, which you would have to define for your resource. The Config can consist of a singular dispatch squad or multiple dispatch squads, the choice is yours! See the example resource config for more info.

dispatch:stopDispatch

Citizen.CreateThread(function()
	TriggerServerEvent('dispatch:stopDispatch', {'Ballas'})
end)

This event takes a table of Names. These names should correspond with the names inside your Config. What this does is essentially stop an area from listeining for triggering events, so NPCs won't spawn.

Configuration

Config.DebugMode - Show aoe markers or not.

Config.DispatchSquads - Table of configured dispatch squads.

Within Each DispatchSquad You Can Configure

Name - Name of the squad

AlliesWith - Group hash they will be allies with

EnemiesWith - player job (ESX) they will be enemies with

Event - What event will trigger the squad to spawn. Examples include gun shots, has weapon out, honks horn, etc. See full list here.

NumberOfWaves - # waves of npcs

NumberPerWave - # npcs per wave

TimeBetweenWaves - time in ms between waves

TimeBeforeUpAgain - time before dispatch is up again

TriggerDistance - distance can be triggered

CentralPos - Central position of dispatch

RepSet - throw up gang signs before attacking

TauntOnKill - take pictures if player dies or leaves

NPCs - table of npc hashes

NPCWeapons - table contianing weapon hash and type

NPCSpawnPoints - spawn points for npcs

Pictures

example1 Notice here because my job is Vagos and im shooting in the Ballas area, the NPCs start spawning and attacking me.

example2 Since my job is Vagos, no NPCs spawn when I shoot because they are allied with me.

example3 You also have the option for the NPCs to take pictures of you if you die or leave the area :-)

Things to note

If there is a shocking event in the AOE, a dispatch will spawn for every player in the aoe (that's configured as an enemy). So for example, if you had a dispatch configured to spawn 2 waves with 2 enemies each wave, but there were 3 enemy players in the AOE when it was triggered... then 6 waves with 6 enemies each wave will spawn. This can become very difficult very quick, so I'm currently looking at ways to make it not scale linearaly.

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.