Veil Development Documentation
  • General
    • Documentation
    • Support
  • Paid Resources
    • Gang System
      • Installing the Resource
      • Creating Gang Sprays
      • Setup
      • Activity System Guide
      • Listeners
      • Common Errors
      • Available Functions
      • Commands
    • Government System
      • Installing the Resource
      • Setup
      • Listeners and Exports
      • Item Setup
    • K9 System
      • Installing the Resource
    • Image Placer
      • Installing the Resource
      • Setup
Powered by GitBook
On this page
  1. Paid Resources
  2. Gang System

Available Functions

This page details available functions to help you make your custom changes to the system or script your own unique activity.

Client Functions

Functions.RayCast(dist: number, ignore_entity: entity) -> hit: boolean, endCoords: vector3, entityHit: entity, surfaceNormal: number, materialHash: string
Functions.Reload() --- Reloads the players Gang Data in the UI
Functions.LoadModel(model: strig) -> boolean
Functions.RequestScaleform(scaleform: scaleform]) -> loaded scaleform
Functions.PlacePed(cb: function], model: string]) -> vector4
Functions.GetCurrentGangTurf() -> string
Functions.GetCenterOfTurf(gangid: string) -> vector3
Functions.Get_Gang_Color() -> number
Functions.new_cam(is_spline: boolean) -> camera
Functions.new_player_cam() -> player camera
Functions.Fade() --- Fades and Unfades the screen for transitions
Functions.IsCoordinatesAtZero(coords: vector3 | vector4, is_vector4: boolean) -> boolean
Functions.Get_Heading_Between_Coords(coords1: vector3, coords2: vector3) -> number
Functions.PlaySound(soundName: string, volume: number) -- Plays sound if it is in the web/sounds folder
Functions.Generate_Random_Coordinates_By_Points(points: TerritoryPoints) -> vector3
-- ^ How to get territory points? -> GlobalState.GangData[gangid]?.territory?.points
Sprays.RequestSpray(gang: string, inEnemyTurf: boolean, enemyGang: string) -- Initiates Spraying Feature
-------------------------------------------------------------------------------
-- ^Here is a way to get inEnemyTurf and enemyGang if you need it. See below
local turf = Functions.GetCurrentGangTurf()
local inEnemyTurf, enemyGang
local plygang = QBCore.Functions.GetPlayerData().gang.name
if not (turf == plygang) then
    inEnemyTurf = true
    enemyGang = turf
end
Sprays.RequestSpray(plygang, inEnemyTurf, enemyGang)
-------------------------------------------------------------------------------

Server Functions

Territories:isPointInTerritory(coords: vector3, territory_points: TerritoryPoints) -> boolean
GetMembersOnline(gangid: string) -> number
Is_User_Main_Leader(gang: string, cid: string) -> boolean
Is_User_A_Gang_Leader(gang: string, cid: string) -> boolean
AddNotorietyToGang(gang: string, amount: number) -> boolean
Territories:getZone(source: number, coords: vector3 | vector4) -> string
Territories:does_territory_exist(gang: string, terid: string) -> boolean
TrapHouse:Fetch(id: string) -> table, class
TrapHouse:HasFunds(gang: string, amount: number) -> boolean
TrapHouse:GetStatus(id: string) -> number
Server.GetRandomSource() -> source
Server.GetRandomSourceNearCoords(coords: vector3) -> source 
-------- Trap House Class Functions ----------
# To use these you need to get the class, see below
local _, traphouse = TrapHouse:Fetch(id)
----------------------------------------------
traphouse:getWorth() -> number
traphouse:delete() -> nil -- Deletes the traphouse from the world, not the database
traphouse:getVehicles() -> table: { [1]: { model: string, props: table, parking_spot: number, ter_id: string, stored_by: string, stored_on: string} }
traphouse:status() -> number
traphouse:saveGangData() -> nil -- Saves the traphouse to the database
traphouse:changeStats(status: number) -> boolean -- Changes the status
traphouse:getPlayers(with_data: boolean) -> table -- Returns all players inside the traphouse
traphouse:deregisterAllPlayers() -> nil -- Removes all players out of the traphouse

Server Exports

exports['veil-gangs']:AddNotorietyToGang(gang: string, amount: number, source?: number, zone?: string)
exports['veil-gangs']:RemoveNotorietyFromGang(gang: string, amount: number, source?: number, zone: string)

For the zone variable, please utilize the following function on the server side

  • Territories:getZone(source: number, coords: vector3) -> zone: string

If the zone variable is not provided it will use the provided source and use the current coords of that player for the zone notoriety change

For the source variable, please utilize either Server.GetRandomSource or Server.GetRandomSourceNearCoords to fulfill that requirement

PreviousCommon ErrorsNextCommands

Last updated 9 months ago