GetVehicleModelAudioSettings: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Simplify examples) |
||
Line 30: | Line 30: | ||
{{Note|This function only works with standard vehicle models. For custom models, it will return the audio settings of the parent model.}} | {{Note|This function only works with standard vehicle models. For custom models, it will return the audio settings of the parent model.}} | ||
== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | -- Retrieve and display the engine-on sound bank ID for Infernus (model 411) | ||
local | local settings = getVehicleModelAudioSettings(411) | ||
if | if settings then | ||
outputChatBox("Infernus engine | outputChatBox("Infernus engine sound ID: " .. tostring(settings["engine-on-soundbank-id"])) | ||
else | else | ||
outputChatBox("Failed to retrieve audio settings | outputChatBox("Failed to retrieve audio settings.") | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== |
Revision as of 17:34, 25 July 2025
Syntax
table getVehicleModelAudioSettings ( int modelID )
Required Arguments
- modelID: The vehicle model ID to retrieve audio settings for
Returns
Returns a table containing audio settings if successful, false otherwise. The returned table contains the following properties:
- sound-type - Sound effect type
- engine-on-soundbank-id - Engine startup sound bank ID (0-410)
- engine-off-soundbank-id - Engine shutdown sound bank ID (0-410)
- bass-setting - Bass settings
- bass-eq - Bass equalizer
- field-c - Field C parameter
- horn-ton - Horn tone
- horn-high - Horn high frequency
- engine-upgrade - Engine upgrade sound effect
- door-sound - Door sound effects
- radio-num - Radio number
- radio-type - Radio type
- vehicle-type-for-audio - Audio vehicle type
- horn-volume-delta - Horn volume delta
Example
-- Retrieve and display the engine-on sound bank ID for Infernus (model 411) local settings = getVehicleModelAudioSettings(411) if settings then outputChatBox("Infernus engine sound ID: " .. tostring(settings["engine-on-soundbank-id"])) else outputChatBox("Failed to retrieve audio settings.") end