Added in debug spheres for active vehicles

This commit is contained in:
Dan
2019-11-30 17:13:16 +00:00
parent cfed828311
commit 88da4310cb

View File

@@ -311,7 +311,7 @@ function RADAR:ShootCustomRay( localVeh, veh, s, e )
local hit, relPos = self:GetLineHitsSphereAndDir( pos, radius, s, e ) local hit, relPos = self:GetLineHitsSphereAndDir( pos, radius, s, e )
if ( hit ) then if ( hit ) then
UTIL:DrawDebugSphere( pos.x, pos.y, pos.z, radius, { 255, 0, 0, 40 } ) -- UTIL:DrawDebugSphere( pos.x, pos.y, pos.z, radius, { 255, 0, 0, 40 } )
return true, relPos, dist, entSpeed, size return true, relPos, dist, entSpeed, size
end end
@@ -332,8 +332,10 @@ function RADAR:GetVehsHitByRay( ownVeh, vehs, s, e )
local d = {} local d = {}
d.veh = veh d.veh = veh
d.relPos = relativePos d.relPos = relativePos
d.dist = UTIL:Round( distance, 2 ) -- Possibly remove -- d.dist = UTIL:Round( distance, 2 ) -- Possibly remove
d.speed = UTIL:Round( speed, 3 ) -- d.speed = UTIL:Round( speed, 3 )
d.dist = distance
d.speed = speed
d.size = size d.size = size
table.insert( t, d ) table.insert( t, d )
@@ -509,12 +511,12 @@ end
function RADAR:InsertDynamicRadiusData( key, radius, actualSize ) function RADAR:InsertDynamicRadiusData( key, radius, actualSize )
if ( self:GetDynamicDataValue( key ) == nil ) then if ( self:GetDynamicDataValue( key ) == nil ) then
local tbl = {} local t = {}
tbl.radius = radius t.radius = radius
tbl.actualSize = actualSize t.actualSize = actualSize
self:SetDynamicRadiusKey( key, tbl ) self:SetDynamicRadiusKey( key, t )
end end
end end
@@ -818,6 +820,17 @@ Citizen.CreateThread( function()
UTIL:DrawDebugLine( startP, endP ) UTIL:DrawDebugLine( startP, endP )
end end
local av = RADAR:GetActiveVehicles()
for ant in UTIL:Values( { "front", "rear" } ) do
for i = 1, 2, 1 do
if ( av[ant] ~= nil and av[ant][i] ~= nil ) then
local pos = GetEntityCoords( av[ant][i].veh )
UTIL:DrawDebugSphere( pos.x, pos.y, pos.z, 5.0, { 255, 0, 0, 100 } )
end
end
end
Citizen.Wait( 0 ) Citizen.Wait( 0 )
end end
end ) end )