while true do
wait(0)
local cam_x, cam_y, cam_z = getActiveCameraCoordinates()
local width, heigth = convertGameScreenCoordsToWindowScreenCoords(339.1, 179.1)
local cross_x, cross_y, cross_z = convertScreenCoordsToWorld3D(width, heigth, 100)
local result, pointer = processLineOfSight(cam_x, cam_y, cam_z, cross_x, cross_y, cross_z, false, false, true, false, false, false, false)
if result then
if isLineOfSightClear(cam_x, cam_y, cam_z, pointer.pos[1], pointer.pos[2], pointer.pos[3], true, true, false, true, true) then
if pointer.entityType == 3 then
if getCharPointerHandle(pointer.entity) ~= playerPed then
changeCrosshairColor(0xFF0000FF)
else changeCrosshairColor(0xFFFFFFFF)
end
end
end
end
end