To reduce selected ambient aircraft in FiveM, create a client resource that calls SetVehicleModelIsSuppressed for an explicit list of model hashes. This targets natural spawning of those models; it is not a permission system and does not guarantee that another resource cannot create the same aircraft.
Test every model on the current FiveM client and game build. Native behaviour and ambient population can differ by location and build. Keep the model list small and preserve a rollback.
Create the resource
Yaratmak resources/[local]/ambient_aircraft_control with these two files.
fxmanifest.lua:
fx_version 'cerulean'
game 'gta5'
author 'Your name'
description 'Suppress selected ambient aircraft models'
version '1.0.0'
client_script 'client.lua'
client.lua:
local suppressedModels = {
`luxor`,
`shamal`,
`maverick`,
`frogger`,
}
CreateThread(function()
for i = 1, #suppressedModels do
SetVehicleModelIsSuppressed(suppressedModels[i], true)
end
end)
AddEventHandler('onResourceStop', function(resourceName)
if resourceName ~= GetCurrentResourceName() then
return
end
for i = 1, #suppressedModels do
SetVehicleModelIsSuppressed(suppressedModels[i], false)
end
end)
The backtick values are CfxLua compile-time hashes. The current runtime and manifest forms are documented by Cfx.re in the CfxLua guide Ve resource manifest reference.
Choose the scope deliberately
Only include models you have observed spawning ambiently and actually want to suppress. The example names are illustrative GTA V aircraft models, not a recommended universal list. A scripted mission, admin command or vehicle shop may still create a suppressed model. If the goal is to control player access, enforce that in the authoritative server-side resource that grants or spawns vehicles.
Do not run the native every frame
The suppression state does not require a zero-delay loop in this resource. Apply it when the resource starts and reverse it when the resource stops. A permanent Wait(0) loop adds work without proving better behaviour.
Test before production
- Back up the existing traffic or population resource.
- Eklemek
ensure ambient_aircraft_controlon a development server. - Koşmak
refreshVeensure ambient_aircraft_control. - Observe known ambient-aircraft locations long enough to compare the same conditions before and after.
- Spawn an aircraft through any approved scripted workflow to confirm whether that separate use should remain available.
- Stop the resource and verify that its suppression state is reversed.
When suppression is not enough
If another resource repeatedly creates aircraft, change that resource’s configuration or server-authorized spawn path. If you need broader density changes, treat them as a separate population-management task and measure side effects on traffic, missions and other resources. Do not combine unrelated density natives into this small fix without a specific test.
