-
-
Notifications
You must be signed in to change notification settings - Fork 452
Vehicle audio settings #2350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vehicle audio settings #2350
Conversation
What about RC Rider or RC Plane sound ? |
They're just vehicles like infernus, dodo, jetmax etc, there should not be a problem with those. |
Merge conflicts must be resolved. |
This draft pull request is stale because it has been open for at least 90 days with no activity. Please continue on your draft pull request or it will be closed in 30 days automatically. |
Merge conflicts solved |
Nice feature. I think this should be added. Radio sync (#2781) is a different feature that can be added later. |
@TheNormalnij Please resolve conflicts and see if there's anything you would have done differently if you'd make this feature in 2024 |
Will it work with allocated model IDs (engineRequestModel) ? |
Bump? |
yes |
Is it still in progress? |
It would be nice to have this new feature, does it need testing? |
It seems that there is still some script left to work, that's what I think |
I'd love to see it merged. @TheNormalnij please, resolve the conflicts. |
Works with engine request model ids? |
setVehicleAudioSetting and getVehicleAudioSetting should work with aloocated models. |
Thank you for all the work on this, it will be nice to present for MTA 1.6.1 |
Nice that this got added |
yes, it's huge for MTA |
Also, i didnt see TheNormalnij active so much in recent weeks, it would be better if someone else adds documentation to wiki? Anyone interested? |
Works well for me, here is a small snippet if anyone wants to test it: local replaceDefaultSoundsEnabled = (type(setVehicleModelAudioSetting) == "function" and true or false)
local customParameters = {
[478] = getVehicleModelAudioSettings(411) -- # walton <> infernus
}
local possibleValues = {
["sound-type"] = true, ["engine-on-soundbank-id"] = true, ["engine-off-soundbank-id"] = true, ["bass-setting"] = true, ["bass-eq"] = true, ["field-c"] = true,
["horn-ton"] = true, ["horn-high"] = true, ["engine-upgrade"] = true, ["door-sound"] = true, ["vehicle-type-for-audio"] = true, ["horn-volume-delta"] = true
}
addEventHandler("onClientResourceStart", resourceRoot, function()
if not replaceDefaultSoundsEnabled then
return
end
for modelId, values in pairs(customParameters) do
for key, value in pairs(values) do
if possibleValues[key] then
setVehicleModelAudioSetting(modelId, key, value)
end
end
end
-- # fix streaming after resource start [instantly change sound of vehicle, otherwise you need to use engineRestreamWorld()]
for _, vehicle in ipairs(getElementsByType("vehicle", root, true)) do
local model = getElementModel(vehicle)
if customParameters[model] then
local values = customParameters[model]
for key, value in pairs(values) do
if possibleValues[key] then
setVehicleAudioSetting(vehicle, key, value)
end
end
end
end
end)
addEventHandler("onClientResourceStop", resourceRoot, function()
if not replaceDefaultSoundsEnabled then
return
end
for modelId in pairs(customParameters) do
resetVehicleModelAudioSettings(modelId)
end
end) |
You broke custom vehicles default sounds, I will open an issue. |
Hi, everybody. It's a old feature, that provide vehicle audio settings interface.
Possible parameters:
I didn't check this code last time. Maybe it can cause crash with wrong *-soundbank-id parameters