This version provides the “silent feature” and the bleping sound. The alternate siren sound is desactivated (commented in the script) due to the need of a loop with all players each ticks.
The script does not work properly with OneSync, the driver sees the difference between CODE 2 (lights without sound) and CODE 3 (lights with sound), but people around them still hear the vehicle in CODE 3 (Problem of synchronization).
checkForSilentSirens() {
for (let index = 0; index < 64; index++) {
if (NetworkIsPlayerActive(index)) {
const playerVeh = GetVehiclePedIsUsing(GetPlayerPed(index));
if (playerVeh) {
Try chaning that to
checkForSilentSirens() {
for (let index = 0; index < 255; index++) {
if (NetworkIsPlayerActive(index)) {
const playerVeh = GetVehiclePedIsUsing(GetPlayerPed(index));
if (playerVeh) {
Not sure at all if it will work / fix it ( it look pretty much the same as an normal lua code )