GetVehicleAudioSettings
Jump to navigation
Jump to search
Syntax
table getVehicleAudioSettings ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle element to retrieve audio settings from
Returns
Returns a table containing audio settings if successful, false otherwise. The returned table contains the following properties:
- sound-type - Sound effect type (integer)
- 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 (float)
- bass-eq - Bass equalizer (float)
- field-c - Field C parameter (float)
- horn-ton - Horn tone (float)
- horn-high - Horn high frequency (float)
- engine-upgrade - Engine upgrade sound effect (float)
- door-sound - Door sound effects (float)
- radio-num - Radio number (float)
- radio-type - Radio type (float)
- vehicle-type-for-audio - Audio vehicle type (float)
- horn-volume-delta - Horn volume delta (float)
Example
-- Get the player's current vehicle and display its audio settings local player = getLocalPlayer() local vehicle = getPedOccupiedVehicle(player) if vehicle then local settings = getVehicleAudioSettings(vehicle) if settings then outputChatBox("=== Vehicle Audio Settings ===") outputChatBox("Sound Type: " .. tostring(settings["sound-type"])) outputChatBox("Engine On Sound Bank: " .. tostring(settings["engine-on-soundbank-id"])) outputChatBox("Engine Off Sound Bank: " .. tostring(settings["engine-off-soundbank-id"])) outputChatBox("Horn Tone: " .. tostring(settings["horn-ton"])) outputChatBox("Horn High: " .. tostring(settings["horn-high"])) outputChatBox("Door Sound: " .. tostring(settings["door-sound"])) outputChatBox("Radio Type: " .. tostring(settings["radio-type"])) else outputChatBox("Failed to retrieve vehicle audio settings.") end else outputChatBox("You must be in a vehicle to use this command.") end