Missions

The script only includes a dummy mission used for testing where you can see the code to learn how it works.

  • Missions config is located in server/editable/missions.lua to prevent any player from dumping the files and see the info.

  • Config.Missions is the table with all available missions, the one included is just a test mission that only triggers the server event 'av_gangs:testmission' and nothing else.

Adding Missions

  • Use the following export server side to add a new mission:

local mission = {
    name = "test_robbery", -- an unique identifier, keep it simple
    label = "Test Robbery", -- shown in app as mission title
    price = 2500, -- number or false
    difficulty = 1, -- from 0 to 5
    cops = 0, -- min cops online to start mission
    level = 0, -- min gang level required
    image = "https://r2.fivemanage.com/QmVAYSlqeAlD4IxVbdvu5/laundromat.png",
    description = "A short description for your heist",
    isClient = false, -- true it will trigger "event" client side, false will trigger it server side
    event = "av_gangs:testmission", -- server event to trigger or false to use onTrigger function
    autoStarted = true, -- set the mission status to "started" as soon as it's activated
    canStart = function(playerId, gang)
      -- run your own server check and return true to allow player to start mission
      -- this function runs before any removeMoney or cops check
      return true
    end,
    onTrigger = function(playerId, gang) -- This is triggered server side and only available if event = false
      -- You can use this to trigger an export or event
      -- EXAMPLE
      --[[
        exports['my_heist_script']:StartHeist(playerId)
      ]]--
    end,
}
exports['av_gangs']:registerMission(mission)
  • The following event will make the mission available/unavailable for everyone:

-- mission:string = the mission identifier
-- started:boolean = true or false, true will make it available
TriggerEvent('av_gangs:updateMission', "test_robbery", true)

Mission Crew

You can enable this feature in av_gangs/config/crew.lua > Config.UseCrew

There's a little panel where you can create a group (requires av_groups), this panel only generates the group + handle invites, for a complete control of the group please check Groups page for a list of available exports you can use on your own resources.

  • If using the av_gangs crew make sure to always set 'av_gangs' as your resource in the av_groups exports, example retrieving all crew members:

-- This will return a table with all crew members
local playerId = 1 -- player server id
local resourceName = 'av_gangs' -- resource name the group belongs to
local playerGroup = exports['av_groups']:getPlayerGroup(playerId, resourceName)

Last updated