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.
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 ^^
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