ngd-planecrashV2

ngd-planecrash is an engaging interactive FiveM script that involves players crashing a military transport aircraft.

Features:

  • Police duty check to start the robbery.

  • Global reset built in, so if players change their mind or give up the heist will reset automatically after the configured amount of time.

  • Global cooldown so that players can't continuously spam the heist.

  • Each loot box is individually configurable for items.

  • Discord logs.

  • Extensive config that allows you to completely move/change/configure the heist to your server's needs.

  • Police can't loot the loot crates.

Dependencies:

  • QB/ESX/QBOX

  • QB/ESX/OX/PS/QS Inventory

  • Target

  • Progressbars

  • OX/QB Zones

Preview Video: Here

Installation:

  • Drag/Drop ngd-planecrashV2 into your resource folder.

  • Add: ensure ngd-planecrashV2 into your server.cfg at the bottom

  • Add images from the img folder into your inventories image folder.

  • Add items into your framework from the readme.

  • Configure script to meet your needs

The script 'can' be restarted live to set things up. I recommend restarting your server after your changes before thoroughly testing everything you have changed.

Click to view config!
-- ██    ██ ████████ ██ ██      ██ ████████ ██ ███████ ███████
-- ██    ██    ██    ██ ██      ██    ██    ██ ██      ██
-- ██    ██    ██    ██ ██      ██    ██    ██ █████   ███████
-- ██    ██    ██    ██ ██      ██    ██    ██ ██           ██
--  ██████     ██    ██ ███████ ██    ██    ██ ███████ ███████

Config.debug = false                                 --prints/zones
Config.BridgeDebug = false                          --Bridge debug
Config.PoliceRequired = 1                           --Amount of police required
Config.PoliceJob = { ['police'] = 0, ['taxi'] = 0 } --Police jobs
Config.AlarmResetPolice = 5                         --Time before heist resets after police clear alarm panel
Config.FinalResetPolice = 10                        --Time before heist resets after police clear main scene
Config.Cooldown = 60                                --Time before heist can be done again
Config.HackPoliceChance = 75                        --% Chance to call police on hack fail.
Config.TotalTime = 45                               --Time before heist is reset after it is started.
Config.FinalBlipTime = 3                            --Time blip zone stay on map of the person that triggered the crash before it goes away.
Config.FinalPoliceTime = 1                          --Time before police are called AFTER the civilians were notified of plane crash location.
Config.SDAutoVersion = true                         --Auto detect menu
--Config.SDMenuVersion = 'ox' --Override autodetect if above is false.
Config.AutoDetectNotif = true                       --Detect framework to use default framework notifications.  If false - Set your own notifications.
--Notifications:
Config.Notification = function(title, message, length, type)
    if Config.AutoDetectNotif then
        if Bridge.Framework == 'esx' then
            exports["esx_notify"]:Notify(type, time, message)
        elseif Bridge.Framework == 'qb' then
            TriggerEvent('QBCore:Notify', { caption = message, text = title, length, type })
        end
    else
        --Custom Notification
    end
end

-- ███████ ████████  █████  ██████  ████████     ██████  ███████ ██████
-- ██         ██    ██   ██ ██   ██    ██        ██   ██ ██      ██   ██
-- ███████    ██    ███████ ██████     ██        ██████  █████   ██   ██
--      ██    ██    ██   ██ ██   ██    ██        ██      ██      ██   ██
-- ███████    ██    ██   ██ ██   ██    ██        ██      ███████ ██████

--Location of peds to start heist.  One is chosen at random on script start.
Config.StartPeds = {
    [1] = {
        Location = vector4(-186.29, -1111.77, 36.14, 312),
        Ped = 's_m_y_construct_01',
        PedIcon = "fa-solid fa-network-wired",
        PedLabel = "Start Alarm Work",
    },
    [2] = {
        Location = vector4(1386.61, -785.76, 67.42, 298),
        Ped = 's_m_y_construct_01',
        PedIcon = "fa-solid fa-network-wired",
        PedLabel = "Start Alarm Work",
    }
}


-- ██   ██  █████   ██████ ██   ██
-- ██   ██ ██   ██ ██      ██  ██
-- ███████ ███████ ██      █████
-- ██   ██ ██   ██ ██      ██  ██
-- ██   ██ ██   ██  ██████ ██   ██

--Items allowed to over ride hack panel
Config.BypassItems = {
    "security_card_01",
    "security_card_02",
}

--Minigame Configs
Config.AlarmPanelCharacters =
'random'                    -- Options: ('numeric', 'alphabet', 'alphanumeric', 'greek', 'braille', 'runes', 'arabic' or 'random' for a randomly selected one.)
Config.AlarmPanelTimer = 15 -- The default amount of time (in seconds) that the hack allows (you can set this in the function as well.)


--  █████  ███    ██ ██ ███    ███  █████  ████████ ██  ██████  ███    ██ ███████
-- ██   ██ ████   ██ ██ ████  ████ ██   ██    ██    ██ ██    ██ ████   ██ ██
-- ███████ ██ ██  ██ ██ ██ ████ ██ ███████    ██    ██ ██    ██ ██ ██  ██ ███████
-- ██   ██ ██  ██ ██ ██ ██  ██  ██ ██   ██    ██    ██ ██    ██ ██  ██ ██      ██
-- ██   ██ ██   ████ ██ ██      ██ ██   ██    ██    ██  ██████  ██   ████ ███████

--Animations for doing stuff
Config.Animations = {
    PickUpTime = math.random(3000, 10000),
    PickUpDict = 'amb@medic@standing@tendtodead@idle_a',
    PickUpAnim = 'idle_c',
    OpenLootBoxTime = 3000,
    OpenCrateDict = 'amb@medic@standing@tendtodead@idle_a',
    OpenCrateAnim = 'idle_a'
}

-- ██       ██████   ██████  ████████
-- ██      ██    ██ ██    ██    ██
-- ██      ██    ██ ██    ██    ██
-- ██      ██    ██ ██    ██    ██
-- ███████  ██████   ██████     ██

--Items given for opening loot boxes
Config.LootItems = {
    ngd_pccargocrate = {
        { item = 'water',    chance = 50, quantity = math.random(1, 2) },
        { item = 'lockpick', chance = 70, quantity = 1 },
    },
    ngd_pcexplosivecrate = {
        { item = 'mastercard',       chance = 100, quantity = 1 },
        { item = 'advancedlockpick', chance = 5,   quantity = 1 },
    },
    ngd_pcammocrate = {
        { item = 'water',    chance = 50, quantity = math.random(1, 2) },
        { item = 'lockpick', chance = 70, quantity = 1 },
    },
    ngd_pclaunchers = {
        { item = 'water',    chance = 50, quantity = math.random(1, 2) },
        { item = 'lockpick', chance = 70, quantity = 1 },
    },
    ngd_pcweapons = {
        { item = 'water',    chance = 50, quantity = math.random(1, 2) },
        { item = 'lockpick', chance = 70, quantity = 1 },
    },
}


-- ███████ ██ ██████  ███████ ████████     ███████ ████████ ███████ ██████      ██       ██████   ██████  █████  ████████ ██  ██████  ███    ██ ███████
-- ██      ██ ██   ██ ██         ██        ██         ██    ██      ██   ██     ██      ██    ██ ██      ██   ██    ██    ██ ██    ██ ████   ██ ██
-- █████   ██ ██████  ███████    ██        ███████    ██    █████   ██████      ██      ██    ██ ██      ███████    ██    ██ ██    ██ ██ ██  ██ ███████
-- ██      ██ ██   ██      ██    ██             ██    ██    ██      ██          ██      ██    ██ ██      ██   ██    ██    ██ ██    ██ ██  ██ ██      ██
-- ██      ██ ██   ██ ███████    ██        ███████    ██    ███████ ██          ███████  ██████   ██████ ██   ██    ██    ██  ██████  ██   ████ ███████

--Locations of the alarm panel and server rack.  One is randomly selected on heist start.
Config.HackLocations = {
    [1] = {           --Ft Zancudo
        HackPanel = { --Location of first part of heist to hack
            coords = vector4(-2350.75, 3244.40, 34.4, 61.0),
            model = 'acp_door_ad'
        },
        ServerRack = { --Location to bring target down aircraft
            coords = vector4(-2351.45, 3257.55, 92.90, 329.00),
            model = 'server_rack_1'
        },
        Guards = { --Location of guards that spawn if player fails hack
            [1] = { coords = vector4(-2322.302, 3259.297, 33.08134, 84.52989), ped = 's_m_m_marine_01', weapon = "WEAPON_PISTOL", health = 150 },
            [2] = { coords = vector4(-2348.148, 3269.262, 32.81077, 235.9547), ped = 's_m_m_marine_01', weapon = "WEAPON_SMG", health = 150 },
            [3] = { coords = vector4(-2357.337, 3252.669, 32.81072, 328.8727), ped = 's_m_y_marine_03', weapon = "WEAPON_PUMPSHOTGUN", health = 150 },
            [4] = { coords = vector4(-2353.824, 3252.455, 44.26851, 178.9609), ped = 's_m_y_marine_01', weapon = "WEAPON_PISTOL", health = 150 },
            [5] = { coords = vector4(-2353.984, 3252.161, 55.66348, 180.1446), ped = 'csb_ramp_marine', weapon = "WEAPON_PISTOL", health = 150 },
            [6] = { coords = vector4(-2353.817, 3252.452, 67.05952, 205.7022), ped = 's_m_m_marine_02', weapon = "WEAPON_CARBINERIFLE_MK2", health = 150 },
            [7] = { coords = vector4(-2353.205, 3251.936, 84.1503, 107.0116), ped = 's_m_m_marine_01', weapon = "WEAPON_PISTOL", health = 150 },
            [8] = { coords = vector4(-2358.458, 3242.88, 92.90366, 101.7852), ped = 's_m_y_marine_03', weapon = "WEAPON_PISTOL", health = 150 },
            [9] = { coords = vector4(-2352.313, 3251.124, 95.73405, 73.84907), ped = 's_m_y_marine_03', weapon = "WEAPON_PISTOL", health = 150 },
            [10] = { coords = vector4(-2358.248, 3250.222, 101.4508, 252.1778), ped = 's_m_y_marine_03', weapon = "WEAPON_COMBATSHOTGUN", health = 150 },
        }
    },
-- ██████  ██████   █████  ███████ ██   ██     ███████ ██ ████████ ███████ ███████
-- ██      ██   ██ ██   ██ ██      ██   ██     ██      ██    ██    ██      ██
-- ██      ██████  ███████ ███████ ███████     ███████ ██    ██    █████   ███████
-- ██      ██   ██ ██   ██      ██ ██   ██          ██ ██    ██    ██           ██
--  ██████ ██   ██ ██   ██ ███████ ██   ██     ███████ ██    ██    ███████ ███████

--Locations and configurations of crash scenes spawned on last step of heist.
Config.Crash = {
    [1] = {
        guards = { --Location of guards at crash site
            { id = 1, coords = vector4(-672.64, 4141.09, 160.38, 330),    model = 's_m_y_blackops_03', weapon = "WEAPON_ASSAULTRIFLE", health = 300 },
            { id = 2, coords = vector4(-651.58, 4136.79, 164.30, 113),    model = 's_m_y_blackops_01', weapon = "WEAPON_PISTOL",       health = 300 },
            { id = 3, coords = vector4(-651.32, 4128.68, 163.04, 118),    model = 's_m_m_marine_01',   weapon = "WEAPON_PUMPSHOTGUN",  health = 300 },
            { id = 4, coords = vector4(-657.18, 4102.11, 154.73, 204.34), model = 's_m_m_marine_01',   weapon = "WEAPON_HEAVYSNIPER",  health = 300 },
            { id = 5, coords = vector4(-657.83, 4164.46, 159.16, 50.34),  model = 's_m_y_blackops_03', weapon = "WEAPON_HEAVYSNIPER",  health = 300 },

        },
        lootcrates = { --Location, prop model and item you get from picking up loot crates
            { coords = vector4(-669.01, 4121.89, 158.88, 211),   model = 'cargo_crate_1',     item = 'ngd_pccargocrate' },
            { coords = vector4(-660.05, 4122.65, 159.17, 279),   model = 'g_crate',           item = 'ngd_pcexplosivecrate' },
            { coords = vector4(-658.92, 4128.19, 159.82, 358),   model = 'lary_ammo_crate_1', item = 'ngd_pcammocrate' },
            { coords = vector4(-661.82, 4144.45, 160.2, 302.63), model = 'lary_crate_2',      item = 'ngd_pcweapons' },
        },

        aircraft = { --Locaion of center aircraft (THERE CAN ONLY BE ONE, DO NOT ADD MORE!)
            { coords = vector4(-666.34, 4129.87, 159.23, 187), model = 'prop_crashed_heli' },
        },
        fires = { --Location of fires
            { coords = vector3(-665.46, 4127.35, 158.28), spread = 8 },
            { coords = vector3(-671.14, 4127.25, 158.71), spread = 8 },
            { coords = vector3(-674.49, 4142.76, 160.85), spread = 8 },
            { coords = vector3(-665.25, 4131.02, 159.44), spread = 8 },

        },
    },

Debug Mode:

If debug = true in the config you will have access to the following debug commands. This will be helpful if you are trying to move the script locations to somewhere else:

  • /pcstartped - This will respawn the start ped after the script was restarted live.

  • /pcstartfirst - This will spawn the zones and first props to hack and bring down the aircraft.

  • /pcstartsecond - This will spawn the final aircraft down scene.

  • /pcreset - This will reset the heist the same way the cops would reset it.

If you have any problems - Join our Discord for support!

Last updated