[Release] Siren On / Off 2.0 [OneSync fixed]

Hiiii ! :snail:

Soooo, after looking on the forum about an very simple script to turn on or off the siren of LSPD or EMS vehicle, i didn’t find one so i did make my own after looking how Luxart Vehicle Control was working

The code is very simple, here it is :

OLD CODE, ONLY CLIENT SIDE NOT SYNC WITH OTHER PLAYER, USE VERSION 2.0

local sirene = 1
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		-- Check si le joueurs est dans un véhicule
		local playerped = GetPlayerPed(-1)		
		if IsPedInAnyVehicle(playerped, false) then	
			-- Check si le joueurs est conducteur
			local veh = GetVehiclePedIsUsing(playerped)	
			if GetPedInVehicleSeat(veh, -1) == playerped then
				-- Check si il est dans un véhicule de police / EMS
				if GetVehicleClass(veh) == 18 then
					if IsDisabledControlJustReleased(0, 19) then
						if sirene == 0 then
							-- on
							DisableVehicleImpactExplosionActivation(veh, 0)
							sirene = 1
						else
							-- off
							DisableVehicleImpactExplosionActivation(veh, 1)
							sirene = 0
						end
					end
				end
			end
		end
	end
end)

Key “E” = Turning on Siren and light
While Light on, click “ALT” to turn off / on the Siren.

If you want an drop and go : sireneOnOff 2.0.zip (1.3 KB)

UPDATED 02/11/2019

Sooo, i just got the time to update this ressource, this do now have a client AND server side to sync with other player ! Key do not change :slight_smile:

8 Likes

So what makes this better than Luxart? Or any other already existing siren system?

Waaaaaay more ms used, the problem i had with Luxart was the amout of MS used and the spam into NetLogEvent 1 ( if i remember well the cmd ).
And if i remember well i did used an other ressource but it add the same problem, not very optimised

i’m not saying mine is the best, but for people who just want an simple script who do that … i think it’s a good option ^^

Lux has siren on and off with alt whats the difference?

Have you considered pushing a code update to lux? His may have more ms used, but it’s also bc his script is much more in-depth. When yours seems like a fork. I don’t intend to shit on your post though.

Originaly i was going to do that, but i don’t understand some things on Lux and i don’t really have time to take time to understand how his script work and do some optimisation, that’s why i did that ^^
But i understand your post :slight_smile:

Finally something very simple lux has so much unneeded stuff

1 Like

Happy that you like it :slight_smile:

I am wondering how to switch between different siren sound effects.:thinking:

Mmh i didn’t change that so it shhould be the default key, long press E ?

i think is not sync with all the player

Are you sure about that ? I use it on my own server ( OneSync, around 120~ player connected ) and we don’t have any issue :thinking:

Yes i tryed to install it on my server (i have 100+ player online connected with onesync) but it doesn’t sync with player.

Yep, I just saw it too, very strange.
I will post an update when I got it fixed.

As @Rubylium said, it doesn’t have onesync, please, if you can update it we’ll appreciate it

Will work on it when i got time to

1 Like

UPDATE 2.0

  • Fixed sync with other player :slight_smile:
    I did some test with a friend, should be working without any issue, tell me if everything is good !
1 Like

updated btw

updated ^^