<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Balazs159</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Balazs159"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Balazs159"/>
	<updated>2026-06-28T14:04:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleModelAudioSetting&amp;diff=82742</id>
		<title>SetVehicleModelAudioSetting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleModelAudioSetting&amp;diff=82742"/>
		<updated>2026-02-24T14:00:43Z</updated>

		<summary type="html">&lt;p&gt;Balazs159: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|23140|This function sets audio properties for a specific vehicle model. It allows customization of various vehicle sound settings such as engine sounds, horn characteristics, door sounds, and radio settings.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleModelAudioSetting ( int modelID, string property, float value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''modelID:''' The vehicle model ID to modify audio settings for&lt;br /&gt;
*'''property:''' The audio property to set. Valid properties are:&lt;br /&gt;
**&amp;quot;doorSound&amp;quot; - Door sound effects&lt;br /&gt;
**&amp;quot;engine-off-soundbank-id&amp;quot; - Engine off sound bank ID (0-410)&lt;br /&gt;
**&amp;quot;engine-on-soundbank-id&amp;quot; - Engine on sound bank ID (0-410)&lt;br /&gt;
**&amp;quot;hornHigh&amp;quot; - Horn high frequency&lt;br /&gt;
**&amp;quot;hornTon&amp;quot; - Horn tone&lt;br /&gt;
**&amp;quot;hornVolumeDelta&amp;quot; - Horn volume delta&lt;br /&gt;
**&amp;quot;radioNum&amp;quot; - Radio number&lt;br /&gt;
**&amp;quot;radioType&amp;quot; - Radio type&lt;br /&gt;
*'''value:''' The numerical value to set for the specified property&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the audio setting was successfully applied, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{Note|Sound bank IDs for engine sounds must be 410 or lower. Values above this limit will be rejected. Changes only affect newly created vehicles. Existing vehicles will retain their original audio settings. This function only works with standard vehicle models and cannot modify audio settings for vehicles that are already spawned.}}&lt;br /&gt;
{{Tip|This function modifies the audio settings for a '''specific vehicle model''', affecting all newly created vehicles of that model. In contrast, [[setVehicleAudioSetting]] modifies the audio settings for a '''specific vehicle instance'''. Changes made with this function do not affect vehicles that are already spawned.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
===Example 1: Basic Engine Sound Modification===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Modify the engine sound for Infernus (model 411)&lt;br /&gt;
setVehicleModelAudioSetting(411, &amp;quot;engineOnSoundBankID&amp;quot;, 150)&lt;br /&gt;
local vehicle = createVehicle(411, 0, 0, 3)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2: Custom Horn Settings===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Customize horn settings for Sultan (model 560)&lt;br /&gt;
local modelID = 560&lt;br /&gt;
&lt;br /&gt;
-- Set horn properties&lt;br /&gt;
setVehicleModelAudioSetting(modelID, &amp;quot;hornHigh&amp;quot;, 1.5)&lt;br /&gt;
setVehicleModelAudioSetting(modelID, &amp;quot;hornTon&amp;quot;, 0.8)&lt;br /&gt;
setVehicleModelAudioSetting(modelID, &amp;quot;hornVolumeDelta&amp;quot;, 2.0)&lt;br /&gt;
&lt;br /&gt;
outputChatBox(&amp;quot;Sultan horn settings customized!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
-- Spawn a Sultan to test the new horn&lt;br /&gt;
local testVehicle = createVehicle(modelID, 100, 100, 3)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 3: Radio and Door Sound Configuration===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Configure radio and door sounds for Elegy (model 562)&lt;br /&gt;
local elegytModel = 562&lt;br /&gt;
&lt;br /&gt;
-- Set radio properties&lt;br /&gt;
local radioSuccess = setVehicleModelAudioSetting(elegytModel, &amp;quot;radioNum&amp;quot;, 5)&lt;br /&gt;
local radioTypeSuccess = setVehicleModelAudioSetting(elegytModel, &amp;quot;radioType&amp;quot;, 2)&lt;br /&gt;
&lt;br /&gt;
-- Set door sound&lt;br /&gt;
local doorSuccess = setVehicleModelAudioSetting(elegytModel, &amp;quot;doorSound&amp;quot;, 1.2)&lt;br /&gt;
&lt;br /&gt;
if radioSuccess and radioTypeSuccess and doorSuccess then&lt;br /&gt;
    outputChatBox(&amp;quot;Elegy audio settings configured successfully!&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
    -- Create vehicle to test settings&lt;br /&gt;
    local elegy = createVehicle(elegytModel, 200, 200, 3)&lt;br /&gt;
else&lt;br /&gt;
    outputChatBox(&amp;quot;Some audio settings failed to apply.&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 4: Batch Audio Modification===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Function to apply custom audio profile to multiple vehicles&lt;br /&gt;
function applyCustomAudioProfile(models, profile)&lt;br /&gt;
    local successCount = 0&lt;br /&gt;
    &lt;br /&gt;
    for _, modelID in ipairs(models) do&lt;br /&gt;
        local modelSuccess = true&lt;br /&gt;
        &lt;br /&gt;
        for property, value in pairs(profile) do&lt;br /&gt;
            if not setVehicleModelAudioSetting(modelID, property, value) then&lt;br /&gt;
                modelSuccess = false&lt;br /&gt;
                outputChatBox(&amp;quot;Failed to set &amp;quot; .. property .. &amp;quot; for model &amp;quot; .. modelID)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        if modelSuccess then&lt;br /&gt;
            successCount = successCount + 1&lt;br /&gt;
            outputChatBox(&amp;quot;Audio profile applied to model &amp;quot; .. modelID)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return successCount&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Define custom audio profile&lt;br /&gt;
local sportCarProfile = {&lt;br /&gt;
    [&amp;quot;engineOnSoundBankID&amp;quot;] = 200,&lt;br /&gt;
    [&amp;quot;engineOffSoundBankID&amp;quot;] = 180,&lt;br /&gt;
    [&amp;quot;hornHigh&amp;quot;] = 1.8,&lt;br /&gt;
    [&amp;quot;hornVolumeDelta&amp;quot;] = 1.5,&lt;br /&gt;
    [&amp;quot;radioType&amp;quot;] = 3&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Apply to multiple sports cars&lt;br /&gt;
local sportsCars = {411, 506, 451, 602} -- Infernus, Super GT, Turismo, Alpha&lt;br /&gt;
local modifiedCount = applyCustomAudioProfile(sportsCars, sportCarProfile)&lt;br /&gt;
&lt;br /&gt;
outputChatBox(&amp;quot;Modified audio for &amp;quot; .. modifiedCount .. &amp;quot; vehicle models&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*[[getVehicleModelAudioSettings]]&lt;br /&gt;
*[[resetVehicleModelAudioSettings]]&lt;br /&gt;
*[[setVehicleAudioSetting]]&lt;br /&gt;
*[[getVehicleAudioSettings]]&lt;br /&gt;
*[[resetVehicleAudioSettings]]&lt;br /&gt;
{{Vehicle functions|client}}&lt;/div&gt;</summary>
		<author><name>Balazs159</name></author>
	</entry>
</feed>