Vehicle gathering only works if power is on and one of the antennas

This commit is contained in:
Dan
2019-11-26 09:56:05 +00:00
parent 64e24ca9d6
commit 897ced6c2d

View File

@@ -169,6 +169,10 @@ function RADAR:ToggleFastDisplay()
self.vars.settings.fastDisplay = not self.vars.settings.fastDisplay self.vars.settings.fastDisplay = not self.vars.settings.fastDisplay
end end
function RADAR:IsEitherAntennaOn()
return self:IsAntennaTransmitting( "front" ) or self:IsAntennaTransmitting( "rear" )
end
--[[------------------------------------------------------------------------ --[[------------------------------------------------------------------------
Radar basics functions Radar basics functions
@@ -682,7 +686,7 @@ function RADAR:Main()
local plyVeh = GetVehiclePedIsIn( ped, false ) local plyVeh = GetVehiclePedIsIn( ped, false )
-- Check to make sure the player is in the driver's seat, and also that the vehicle has a class of VC_EMERGENCY (18) -- Check to make sure the player is in the driver's seat, and also that the vehicle has a class of VC_EMERGENCY (18)
if ( DoesEntityExist( plyVeh ) and GetPedInVehicleSeat( plyVeh, -1 ) == ped and GetVehicleClass( plyVeh ) == 18 and self:IsPowerOn() ) then if ( DoesEntityExist( plyVeh ) and GetPedInVehicleSeat( plyVeh, -1 ) == ped and GetVehicleClass( plyVeh ) == 18 and ( self:IsPowerOn() and self:IsEitherAntennaOn() ) ) then
local plyVehPos = GetEntityCoords( plyVeh ) local plyVehPos = GetEntityCoords( plyVeh )
-- First stage of the radar - get all of the vehicles hit by the radar -- First stage of the radar - get all of the vehicles hit by the radar