{"id":158077,"date":"2024-09-23T14:44:59","date_gmt":"2024-09-23T12:44:59","guid":{"rendered":"https:\/\/hifivem.com\/?p=158077"},"modified":"2026-08-16T15:16:27","modified_gmt":"2026-08-16T13:16:27","slug":"desactiver-les-avions-et-les-helicopteres","status":"publish","type":"post","link":"https:\/\/rpcrate.com\/fr\/disable-airplanes-and-helicopters\/","title":{"rendered":"Comment d\u00e9sactiver les avions et h\u00e9licopt\u00e8res d'ambiance dans FiveM"},"content":{"rendered":"<p><strong>To reduce selected ambient aircraft in FiveM, create a client resource that calls <code data-no-translation=\"\" translate=\"no\">SetVehicleModelIsSuppressed<\/code> for an explicit list of model hashes.<\/strong> 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.<\/p>\n<p>The configuration and code examples here target FiveM for GTA V Legacy. Enhanced has different runtime and compatibility rules; check <a href=\"https:\/\/docs.fivem.net\/docs\/developers\/legacy-vs-enhanced\/\">Cfx.re\u2019s Legacy-to-Enhanced changes<\/a> before applying them to an Enhanced server.<\/p>\n<div class=\"fivemx-guide-box fivemx-guide-warning\">\n<p>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.<\/p>\n<\/div>\n<h2 id=\"create-the-resource\">Create the resource<\/h2>\n<p>Create <code data-no-translation=\"\" translate=\"no\">resources\/[local]\/ambient_aircraft_control<\/code> with these two files.<\/p>\n<p><code data-no-translation=\"\" translate=\"no\">fxmanifest.lua<\/code>:<\/p>\n<pre data-no-translation=\"\" translate=\"no\"><code data-no-translation=\"\" class=\"language-lua\" translate=\"no\">fx_version 'cerulean'\ngame 'gta5'\n\nauthor 'Your name'\ndescription 'Suppress selected ambient aircraft models'\nversion '1.0.0'\n\nclient_script 'client.lua'\n<\/code><\/pre>\n<p><code data-no-translation=\"\" translate=\"no\">client.lua<\/code>:<\/p>\n<pre data-no-translation=\"\" translate=\"no\"><code data-no-translation=\"\" class=\"language-lua\" translate=\"no\">local suppressedModels = {\n    `luxor`,\n    `shamal`,\n    `maverick`,\n    `frogger`,\n}\n\nCreateThread(function()\n    for i = 1, #suppressedModels do\n        SetVehicleModelIsSuppressed(suppressedModels[i], true)\n    end\nend)\n\nAddEventHandler('onResourceStop', function(resourceName)\n    if resourceName ~= GetCurrentResourceName() then\n        return\n    end\n\n    for i = 1, #suppressedModels do\n        SetVehicleModelIsSuppressed(suppressedModels[i], false)\n    end\nend)\n<\/code><\/pre>\n<p>The backtick values are CfxLua compile-time hashes. The current runtime and manifest forms are documented by Cfx.re in the <a href=\"https:\/\/docs.fivem.net\/docs\/scripting-manual\/runtimes\/lua\/\" rel=\"nofollow noopener\">CfxLua guide<\/a> and <a href=\"https:\/\/docs.fivem.net\/docs\/scripting-reference\/resource-manifest\/\" rel=\"nofollow noopener\">resource manifest reference<\/a>.<\/p>\n<h2 id=\"choose-the-scope-deliberately\">Choose the scope deliberately<\/h2>\n<p>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.<\/p>\n<h2 id=\"do-not-run-the-native-every-frame\">Do not run the native every frame<\/h2>\n<p>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 <code data-no-translation=\"\" translate=\"no\">Wait(0)<\/code> loop adds work without proving better behaviour.<\/p>\n<h2 id=\"test-before-production\">Test before production<\/h2>\n<ol>\n<li>Back up the existing traffic or population resource.<\/li>\n<li>Add <code data-no-translation=\"\" translate=\"no\">ensure ambient_aircraft_control<\/code> on a development server.<\/li>\n<li>Run <code data-no-translation=\"\" translate=\"no\">refresh<\/code> and <code data-no-translation=\"\" translate=\"no\">ensure ambient_aircraft_control<\/code>.<\/li>\n<li>Observe known ambient-aircraft locations long enough to compare the same conditions before and after.<\/li>\n<li>Spawn an aircraft through any approved scripted workflow to confirm whether that separate use should remain available.<\/li>\n<li>Stop the resource and verify that its suppression state is reversed.<\/li>\n<\/ol>\n<h2 id=\"when-suppression-is-not-enough\">When suppression is not enough<\/h2>\n<p>If another resource repeatedly creates aircraft, change that resource&#8217;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.<\/p>\n<h2 id=\"reference-documentation\">Reference documentation<\/h2>\n<p><a href=\"https:\/\/github.com\/citizenfx\/natives\/blob\/master\/VEHICLE\/SetVehicleModelIsSuppressed.md\">Source: citizenfx\/natives<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pour r\u00e9duire les a\u00e9ronefs ambiants s\u00e9lectionn\u00e9s dans FiveM, cr\u00e9ez une ressource client qui appelle SetVehicleModelIsSuppressed pour une liste explicite de hachages de mod\u00e8les. Cela cible l'apparition naturelle de ces mod\u00e8les ; ce n'est pas un syst\u00e8me de permissions et cela ne garantit pas qu'une autre ressource ne puisse pas cr\u00e9er le m\u00eame a\u00e9ronef.<\/p>","protected":false},"author":1,"featured_media":158078,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2340,1899],"tags":[3001],"class_list":["post-158077","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lua-scripting","category-tutorials","tag-fivem-script"],"_links":{"self":[{"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/posts\/158077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/comments?post=158077"}],"version-history":[{"count":5,"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/posts\/158077\/revisions"}],"predecessor-version":[{"id":217362,"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/posts\/158077\/revisions\/217362"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/media\/158078"}],"wp:attachment":[{"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/media?parent=158077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/categories?post=158077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rpcrate.com\/fr\/wp-json\/wp\/v2\/tags?post=158077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}