ELS+ | fic

This is in LUA, btw.

All the keys I’ve disabled:

        SetVehicleRadioEnabled(MyVehicle(), 0)
        DisableControlAction(0, 84, true) -- INPUT_VEH_PREV_RADIO_TRACK  
        DisableControlAction(0, 83, true) -- INPUT_VEH_NEXT_RADIO_TRACK
        DisableControlAction(0, 81, true) -- INPUT_VEH_NEXT_RADIO
        DisableControlAction(0, 82, true) -- INPUT_VEH_PREV_RADIO
        DisableControlAction(0, 85, true) -- INPUT_VEH_RADIO_WHEEL
        DisableControlAction(0, 86, true) -- INPUT_VEH_HORN
        DisableControlAction(0, 199, true) -- FRONTEND_PAUSE_ALTERNATE (for ELS panel)

I guess, in theory, you can create another table: auxSiren[veh]. Then play the sound for each prmSiren[veh] and auxSiren[veh]. Setting auxSiren[veh] = 0 will disable the secondary tone (or any amount of tones)

Hey. I tried doing a little digging around, but couldn’t come up with anything. What are the respective sound id/audio names/audio refs for playing the sirens with that function?

I stress the use of tables because like objects, tables have a state and a life cycle that is independent from where they are created.

local prmSirenSound = {}

function someFunction(veh, state)
  prmSirenSound[veh] = GetSoundId()
  PlaySoundFromEntity(prmSirenSound[veh], "VEHICLES_HORNS_SIREN_1", veh, 0, 0, 0)
end

This allows you to modify the siren-state object (table) we have just created like the example I provided previously.

Each client has its own tables for each siren-state (for each tone) AND each sound-state (to stop each sound).

local prmSiren = {}
local prmSirenSound = {}

so the first table stores the state, and second the sound. When I stop the sound:

StopSound(prmSirenSound[veh])
ReleaseSoundId(prmSirenSound[veh])
prmSirenSound[veh] = nil
1 Like

Awesome. I appreciate your explanations!

Also just to be clear, VEHICLES_HORNS_SIREN_1, VEHICLES_HORNS_SIREN_2, VEHICLES_HORNS_SIREN_3, etc would be the different tones? Also, the 4th argument for the PlaySoundFromEntity function (audioRef) – that can just be 0?

Hes using 0 so maybe

For siren sounds, yes. http://pastebin.com/f2A7vTj0 - I think because it is in resident.rpf and already loaded.

Sound strings:
VEHICLES_HORNS_SIREN_1
VEHICLES_HORNS_SIREN_2
VEHICLES_HORNS_AMBULANCE_WARNING
VEHICLES_HORNS_POLICE_WARNING
VEHICLES_HORNS_FIRETRUCK_WARNING
SIRENS_AIRHORN

Hashes:
0x0EA58C7C - Generic Bullhorn

0x013F5FE7 - PoliceB Main
0x17DDFB5C - PoliceB Secondary

0x0A8960B6 - FIB Primary
0x0A49B203 - FIB Secondary

0x0E0DA7BC - Granger Primary
0x16E74B3E - Granger Secondary

0x1C98C4D5 - Ambulance Primary
0x144C8602 - Ambulance Secondary

0x037CC595- Fire Horn
0x159C9182 - Fire Primary
0x161768E7 - Fire Secondary

I have not experimented with the sound hashes as the native PlaySoundFromEntity() only accepts the char* type not hash.

1 Like

Ahh, okay. It makes sense now. Awesome. Again, thanks for your help!

I wonder if you use hashes and surround them with quotes if it would take them.

No. It must be in the same format as the other strings. If there is a function that converts native hashes to strings, that would work.

I really hope sombody makes a video on how to install this for a 5M server.

The script ain’t even close to being finished. Don’t expect a release or even a video for awhile yet.

Custom sounds are already “allowed” but nobody knows the rockstar format

The Script is now ready for testing for those who know how to compile it. I will soon be adding more docs to the githhub repo to help people.

2 Likes

Why only for people that can compile it? what if im not wanting to clutter my computer with coding programs at this time?..

Then don’t use it…

@Beef Why don’t you go give wrong info to someone else… Ive gotten enough messages about you being wrong with helping people… Want to be a dick? Go somewhere else!

Please explain how I give wrong info in the pm’s

If no one has done so by tonight, I’ll compile them and with the original developers permission upload the files to mega.

4 Likes

@jdc4992 I have spoken with ejb1123 and understand his reasoning… He has a good point on why he doesn’t want to compile them right now. But thank you for the offer.

A major update was just released and so was the test server. If you like what you see more features added, please provide feedback as that is what keeps this project alive.

1 Like