[FREE][ESX] Plane/Heli Blackbox

Requirements

  • ESX/es_extended (not tested with ESX final)

Download

Video

https://streamable.com/f0n9t2

Menu example
esx_policejob/client/main.lua
Search for data.current.value == ‘vehicle_interaction’

Change these things:

if DoesEntityExist(vehicle) then
   table.insert(elements, {label = _U('vehicle_info'), value = 'vehicle_infos'})
   table.insert(elements, {label = _U('pick_lock'), value = 'hijack_vehicle'})
   table.insert(elements, {label = _U('impound'), value = 'impound'})
   if GetVehicleClass(vehicle) == 15 or GetVehicleClass(vehicle) == 16 then
      table.insert(elements, {label = "Check Blackbox", value = 'blackbox'})
   end
end
if action == "search_database" then
    LookupVehicle()
elseif action == "blackbox" then
    ESX.TriggerServerCallback("esx_blackbox:getEntry", function(data)
            local elements = {}

            for i = 1, #data, 1 do
                table.insert(elements, {label = "Entry " .. i, value = data[i]})
            end

            ESX.UI.Menu.Open("default", GetCurrentResourceName(), "blackbox_interaction", {
                    title = "Blackbox data",
                    align = "top-left",
                    elements = elements
                }, function(data3, menu3)
                    ESX.UI.Menu.Open( "default", GetCurrentResourceName(), "blackbox_entry",
                        {
                            title = "Blackbox data",
                            align = "top-left",
                            elements = {
                                {label = "View record", value = "view_rec"},
                                {label = "Delete entry", value = "delete"}
                            }
                        }, function(data4, menu4)
                            if data4.current.value == "view_rec" then
                                TriggerEvent("esx_blackbox:viewRecord", data3.current.value)
                            elseif data4.current.value == "delete" then
                                TriggerServerEvent("esx_blackbox:deleteEntry", "entry", data3.current.value)
                                menu4.close()
                                menu3.close()
                            end
                        end, function(data4, menu4)
                            menu4.close()
                        end)
                end, function(data3, menu3)
                    menu3.close()
                end)
        end, "plate", GetVehicleNumberPlateText(vehicle))
elseif DoesEntityExist(vehicle) then

SQL

CREATE TABLE `blackbox` (
  `id` int(11) NOT NULL,
  `identifier` text DEFAULT NULL,
  `data` longtext DEFAULT NULL,
  `plate` text DEFAULT NULL,
  `model` text DEFAULT '745926877'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Information

  • The planes/helicopters are spawned locally
  • Use /removeBlackboxVeh to delete the spawned vehicles
  • I know it is not perfect at the moment
4 Likes

can you specify how much ms is recorded?

Idle:

Flying:

Cool release!

Thank you :slight_smile:

Sorry, maybe i wasn’t clear. Can you define how many snapshots of the plane it takes? is it based on a certain amount of time?

Every second (It isn’t stored in the db until you leave the aircraft)

nice but dosn’t it take away performance cause there are so many planes spawned?

Shouldn’t

Is there an SQL-Insert command? This needs an table but there is no create command for the table

Oh, sorry. I forgot that

CREATE TABLE `blackbox` (
  `id` int(11) NOT NULL,
  `identifier` text DEFAULT NULL,
  `data` longtext DEFAULT NULL,
  `plate` text DEFAULT NULL,
  `model` text DEFAULT '745926877'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;