require 'lib.moonloader'
local keys = require "vkeys"
function main()
while not isSampLoaded() do wait(100) end
while true do
wait(0)
local playerPed = PLAYER_PED
if isKeyDown(VK_SHIFT) and isKeyDown(VK_RBUTTON) then
local cam_x, cam_y, cam_z = getActiveCameraCoordinates()
local width, heigth = convertGameScreenCoordsToWindowScreenCoords(339.1, 179.1)
local aim_x, aim_y, aim_z = convertScreenCoordsToWorld3D(width, heigth, 100)
local result, colPoint = processLineOfSight(
cam_x, cam_y, cam_z,
aim_x, aim_y, aim_z,
false, false, true, false, false, false, false
)
if result and colPoint and colPoint.entityType == 3 then
local targetPed = getCharPointerHandle(colPoint.entity)
if targetPed and targetPed ~= playerPed and isCharInAnyCar(targetPed) then
writeMemory(0xB7347A, 4, 255, 0)
end
end
end
end
end