Skip to content

10% off shop orders, applied at checkoutBlack Friday: 30% off until Dec 1Server templatesServer templates

RPScripts

Aircraft Company Garage: Legacy ESX Setup and Access Review

By Luke

Aircraft Company Garage
On this page

Aircraft Company Garage is HJDCZY’s resource for company hangars and a limited fleet, originally released for the CNAT flight server. The original repository is HJDCZY/fivem-airport_company_garage. Source inspected at commit 5cb950464ce8e0ebba8258ac43c73513caed8d54 declares version 1.0.0. RPScripts did not create this script.

Original release

Creator source

Prepare legacy dependencies and database rows

The manifest imports es_extended, mysql-async, menuv and PolyZone. Both main Lua files use the old esx:getSharedObject event; adapt that integration to your actual ESX version. Keep the resource directly under resources because its file logger builds that path. garage.sql selects a database named es_extended before creating aircraft_company_garage and aircraft_company; review the database target and back up a test database before importing. Add company aircraft and four-corner hangar coordinates explicitly. school.sql inserts sample aircraft; it is not a complete production configuration.

oxmysql can replace mysql-async: its documentation says you can delete mysql-async and let oxmysql provide that functionality. If the resource’s manifest loads @mysql-async/lib/MySQL.lua, change that line to @oxmysql/lib/MySQL.lua.

Fix company access and fleet reservations

Several server handlers accept a company, target player ID, plate or model from the client without binding the request to the caller’s current job and hangar. State changes do not atomically claim an available aircraft for that company. Validate the caller, configured company, server-side location, vehicle and current availability before changing state or issuing a spawn response. The shared menu lock and its timeout also need review: the timeout functions refer to a different menuinuse variable from the later local lock. Test simultaneous requests and disconnects so a stale menu cannot block every company.

Verify controls and stored state

The inspected key mappings use F6 to open the menu and F3 for the cs storage command; players can remap them. The config.lua file is empty and the manifest does not load it, so setup happens mainly in SQL and the Lua code. The damage column exists, but damage persistence is unfinished. Test fleet availability, return handling, changed jobs, reconnects, model availability and the state stored in the database. This was a source review only; the package was not repaired or tested in game.