Luxart Vehicle Control V3

Shared.lua bro

FOR PASSENGER SEAT CONTROL: (cl_lvc.lua)
Change:

if GetPedInVehicleSeat(veh, -1) == playerped  then
							--IS EMERGENCY VEHICLE
							if GetVehicleClass(veh) == 18 then
								player_is_emerg_driver = true

For This:

if GetPedInVehicleSeat(veh, -1) == playerped or GetPedInVehicleSeat(veh, 0) == playerped then
							--IS EMERGENCY VEHICLE
							if GetVehicleClass(veh) == 18 then
								player_is_emerg_driver = true

IT WORKS! But also need to change down

if GetPedInVehicleSeat(veh, -1) == playerped or GetPedInVehicleSeat(veh, 0) == playerped then
			if state_indic[veh] == nil then
				state_indic[veh] = ind_state_o
			end

AND IMPORTANT, due sincro of lights dont work, supress the control of Q E and R buttons making it work only for driver:

if GetPedInVehicleSeat(veh, -1) == playerped and IsDisabledControlJustReleased(0, 85) then

if GetPedInVehicleSeat(veh, -1) == playerped and IsDisabledControlJustReleased(0, 80) then

if GetPedInVehicleSeat(veh, -1) == playerped and IsDisabledControlPressed(0, 86) then

In all lines that is 80 and 86 too, down are 2 extra, also I supresed the up arrow due menus works with it so doesnt interfere…

-- POWERCALL
							--elseif IsDisabledControlJustReleased(0, 172) and not IsMenuOpen() then
							--	if state_pwrcall[veh] == 0 then
							--		if lights_on then
							--			AUDIO:Play('Upgrade', AUDIO.upgrade_volume)
							--			HUD:SetItemState('siren', true)
							--			SetPowercallStateForVeh(veh, UTIL:GetToneID('AUX'))
							--			count_bcast_timer = delay_bcast_timer
							--		end
							--	else
							--		AUDIO:Play('Downgrade', AUDIO.downgrade_volume)
							--		if state_lxsiren[veh] == 0 then
							--			HUD:SetItemState('siren', false)
							--		end
							--		SetPowercallStateForVeh(veh, 0)
							--	end
							--	AUDIO:ResetActivityTimer()
							--	count_bcast_timer = delay_bcast_timer

For those wondering to change 1 to 0 for sirens due OX Inventory to 6 to 0 here is a solution in cl_lvc.lua i-6 is key…

RegisterKeyMaps = function()
	for i, _ in ipairs(SIRENS) do
		if i ~= 1 then
			local command = '_lvc_siren_' .. i-6 --ARREGLO??
			local description = Lang:t('control.siren_control_desc', {ord_num = MakeOrdinal(i-6)})

			RegisterCommand(command, function(source, args)
				if veh ~= nil and player_is_emerg_driver ~= nil then
					if IsVehicleSirenOn(veh) and player_is_emerg_driver and not key_lock then
						local proposed_tone = UTIL:GetToneAtPos(i-5)
						local tone_option = UTIL:GetToneOption(proposed_tone)
						if i-6 < #UTIL:GetApprovedTonesTable() then
							if tone_option ~= nil then
								if tone_option == 1 or tone_option == 3 then
									if ( state_lxsiren[veh] ~= proposed_tone or state_lxsiren[veh] == 0 ) then
										HUD:SetItemState('siren', true)
										AUDIO:Play('Upgrade', AUDIO.upgrade_volume)
										SetLxSirenStateForVeh(veh, proposed_tone)
										count_bcast_timer = delay_bcast_timer
									else
										if state_pwrcall[veh] == 0 then
											HUD:SetItemState('siren', false)
										end
										AUDIO:Play('Downgrade', AUDIO.downgrade_volume)
										SetLxSirenStateForVeh(veh, 0)
										count_bcast_timer = delay_bcast_timer
									end
								end
							else
								HUD:ShowNotification(Lang:t('error.reg_keymap_nil_1', {i = i, proposed_tone = proposed_tone, profile_name = UTIL:GetVehicleProfileName()}), true)
								HUD:ShowNotification(Lang:t('error.reg_keymap_nil_2'), true)
							end
						end
					end
				end
			end)

			--CHANGE BELOW if you'd like to change which keys are used for example NUMROW1 through 0
			if i > 6 and i < 11 and main_siren_set_register_keys_set_defaults then
				RegisterKeyMapping(command, description, 'keyboard', i-1)
			elseif i == 11 and main_siren_set_register_keys_set_defaults then
				RegisterKeyMapping(command, description, 'keyboard', '0')
			else
				RegisterKeyMapping(command, description, 'keyboard', '')
			end
		end
	end
end

I’m having an issue where players who use controllers are losing the ability to activate lights and sirens at all, they have to take flights and disconnect their controllers before they can get it to work on mouse and keyboard. Is this something you’ve heard of before?

When is next update?

How do you open the RMENU?



How to solve this error?

Does not effect functionality just update checking, it happens occasionally even on my server.

Hey i love this script really much. but somehow i can turn on signals with left alt and arrow up. problem is that my ox target is on alt left. how can i stop using these keys? thanks in advance. cheers

how do i disable ALT turning on lights and siren?

LVC does not activate lights on our police cars and also causes crashes?

Anyone know why the button clicks and the up/downgrade SFX arent playing? All lights and sirens work but just not the SFX for the box.

Hi! Is there any way I can improve the resmon? the script uses 0.05 to 0.11 when not in use by an emergency vehicle. Thanks.

2 Likes

how can i make this script so only selected jobs have access to this control? i downloaded it and all my non els cars in the city now have this ui on screen…

the way it works is that vehicles in the “emergency” section get the control panel. You need to edit the vehicles.

got it cheers

1 Like

As a client, is there anyway to assign more than 3 sirens to a vehicle? For example I have my Ambulance Warning as a police siren, can I assign it as a 4th as a client?

You can assign more than 3 sirens. They will play sequentially after the other sirens, you can also control how sirens are played using the option key but it applies to all assignments for that siren.

See the documentation for more information.