I am basing this off of the default VUmod, so some files may be different.
lua/autorun/client/ClientVehicleScript.lua
In the section with the keybinds and RunConsoleCommands, add
if string.find( bind, "impulse 201" ) then
if AntiCmdSpam + 15 < CurTime() then
RunConsoleCommand("PlaySiren")
AntiCmdSpam = CurTime()
end
return true
end
lua/autorun/VehicleScript.lua
Add this somewhere in the script:
vu_enablesiren = CreateConVar( "vu_enablesiren", "1", { FCVAR_PROTECTED } )
local function PlaySiren( player,cmd,arg )
if player:InVehicle() and vu_enablesiren:GetInt() != 0 then
local vehicle = player:GetVehicle()
if vehicle.VehicleTable && vehicle.VehicleTable.Siren then
player:GetVehicle():EmitSound(vehicle.VehicleTable.Siren.Sound, 100, vehicle.VehicleTable.Siren.Pitch)
end
end
end
concommand.Add( "PlaySiren", PlaySiren
In the file that has the police car vehicle script (Nova_vehicles.lua is the default), add this inside the police car vehicle script somewhere:
I thought we had sirens? Codebase Link