ResetVehicleAudioSettings

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

ADDED/UPDATED IN VERSION 1.6.0 r23140:
This function resets the audio properties of a specific vehicle instance back to its model's default settings. Any custom audio settings that were applied to the vehicle using setVehicleAudioSetting will be removed, restoring the original sound characteristics.

Syntax

bool resetVehicleAudioSettings ( vehicle theVehicle )

Required Arguments

  • theVehicle: The vehicle element to reset audio settings for

Returns

Returns true if the vehicle audio settings were successfully reset, false otherwise.

[[{{{image}}}|link=|]] Note: This function only affects the specific vehicle instance, not the vehicle model's default settings. After calling this function, the vehicle will use the default audio settings for its model.

Example

-- Reset audio settings for the player's current vehicle
local player = getLocalPlayer()
local vehicle = getPedOccupiedVehicle(player)

if vehicle then
    local success = resetVehicleAudioSettings(vehicle)
    if success then
        outputChatBox("Vehicle audio settings have been reset to default.")
    else
        outputChatBox("Failed to reset vehicle audio settings.")
    end
else
    outputChatBox("You must be in a vehicle to use this command.")
end

See Also