Git Product home page Git Product logo

qb-gangs's Introduction

๐Ÿ”ช qb-gangs

Gangs for QB-Core with Gang Support instead of Jobs, supports infinately scaling gangs. Super optimised down to 0.01ms idle with a gang peaking at 0.04ms when drawing or inside of a territory zone, 0.00ms at idle as a civilian.

Features:

Each gang has a stash and a list of vehicles they can get out from their garage. Config is fully customisable for each gang. Gangs can be created in-game with the configurator and bosses and territories can be configured manually.

Changelog

New Version 2.5 Territories Update

This update brings gang territories to the map using PolyZones and server side calculations to provide synchronized gang turfs to fight over. At the moment the serve no over purpose, if you have suggestions open an issue or a PR.

New Version 2.4 Gang Boss Update
  • Gang bosses can now be configured in shared/leaders.lua and they can hire/fire new members
New Version 2.3 In-Game Gang Configurator
  • To begin creating a gang use /creategang [name] [description] to start the process, use /placestash to place the gang stash and /placegarage to place the gang garage using the In-Game configurator to chose the gang colours and vehicle list, when you have placed both you can use /finishgang to complete it or use /cancelgang at any time to abort the process.

Preview

Repository Disclaimer

Tagged releases are considered 'stable' version of this resource, the master branch and others may contain experimental or unfinished code that you may run into problems with. This repo is 1 year old, it was built for the original QBCore and I have no plans on making it compatible with the new versions since the maintainers have decided not to make it backwards compatible.

Installation

Add Gangs into qb-core/shared.lua like this:

QBShared.Gangs = json.decode(LoadResourceFile("qb-gangs", "gangs.json"))

Add event to qb-core/server/events.lua

RegisterServerEvent("QBCore:Server:UpdateGangs")
AddEventHandler("QBCore:Server:UpdateGangs", function(gangs)
	QBShared.Gangs = gangs
	QBCore.Shared.Gangs = gangs
end)

Add event to qb-core/client/events.lua

RegisterNetEvent("QBCore:Server:UpdateGangs")
AddEventHandler("QBCore:Server:UpdateGangs", function(gangs)
	QBShared.Gangs = gangs
	QBCore.Shared.Gangs = gangs
end)

To enable lockable doors for gangs, you need to modify qb-doorlocks/client/main.lua line 217 like this:

function IsAuthorized(doorID)
	local PlayerData = QBCore.Functions.GetPlayerData()

	for _,job in pairs(doorID.authorizedJobs) do
		if job == PlayerData.job.name then
			return true
		end
	end

	for _,gang in pairs(doorID.authorizedJobs) do
		if gang == PlayerData.gang.name then
			return true
		end
	end
	
	return false
end

Add Citizenids for gang leaders for each gang into server/config.lua like this:

Config = {
	["GangLeaders"] = {
		["ballas"] = {
			"ORJ52463",
			"ABC12345"
		},
		["marabunta"] = {

		},
		["vagos"] = {

		},
		["families"] = {
			
		},
		["lost"] = {

		}
	}
}

Interiors used:

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

qb-gangs's People

Contributors

liamdormon avatar sw1ft 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.