Skip to content

Unlock sirens for all vehicle types, including custom models#4959

Open
TheCrazy17 wants to merge 1 commit into
multitheftauto:masterfrom
TheCrazy17:fix/siren-custom-vehicles
Open

Unlock sirens for all vehicle types, including custom models#4959
TheCrazy17 wants to merge 1 commit into
multitheftauto:masterfrom
TheCrazy17:fix/siren-custom-vehicles

Conversation

@TheCrazy17

@TheCrazy17 TheCrazy17 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

addVehicleSirens / setVehicleSirens previously only had a visible effect on stock
cars (and the HPV1000 bike), because GTA only renders siren coronas for models 407-599.
This makes scripted sirens render — lights and sound, on every vehicle type:

  • Custom (engineRequestModel) vehicles and out-of-range stock models (400-406,
    600-611) now render sirens (the CAutomobile::PreRender model-id gate is bypassed for
    vehicles that carry scripted sirens).
  • Bikes, BMX, boats, planes, helis and trains now draw siren coronas via new
    PreRender entry hooks, these classes had no native siren rendering at all.
  • The siren sound now plays for boat/aircraft/train audio types
    (CAEVehicleAudioEntity::ProcessVehicle only ran it for car/bike/bmx).
  • The vehicle-type checks in addVehicleSirens / setVehicleSirens (client + server)
    were relaxed to allow every vehicle class; only typeless/invalid vehicles are rejected.
mta-screen_2026-06-17_00-30-24

Motivation

Closes #4090

It also ticks one item off #1861 sirens being one of those features. It doesn't close, but it's one
less thing on the list. And honestly, I just enjoy closing issues and expanding what
you can do in MTA. :)

Test plan

Run this in client-side, get in a vehicle and enjoy:

addEventHandler('onClientPlayerVehicleEnter', root, function(vehicle, seat)
      addVehicleSirens(vehicle, 2, 2)
      setVehicleSirens(vehicle, 1, -0.4, 0, 3, 0, 0, 255, 255, 255)
      setVehicleSirens(vehicle, 2, 0.4, 0, 3, 255, 0, 0, 255, 255)
      setVehicleSirensOn(vehicle, true)
end)

addEventHandler('onClientPlayerVehicleExit', root, function(vehicle, seat)
   removeVehicleSirens(vehicle)
end)

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

addVehicleSirens now renders on custom (engineRequestModel) vehicles and
every vehicle class (bikes, BMX, boats, planes, helis, trains), with siren
sound on boat/aircraft/train audio types. Closes multitheftauto#4090.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

addVehicleSirens doesn't work with custom vehicles

1 participant