require 'moonloader'
function main()
while not isSampAvailable() do wait(0) end
while true do wait(0)
-- if isKeyDown(VK_RBUTTON) and isKeyJustPressed(VK_Q) then -- если зажать ПКМ и нажать Q и навести прицел на игрока - ВЫСТРЕЛ
if 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, elements.Float.triggerDistance.v)
local result, colPoint = processLineOfSight(cam_x, cam_y, cam_z, aim_x, aim_y, aim_z, false, false, true, false, false, false, false)
local weap = isCurrentCharWeapon(PLAYER_PED,)
if result and isCurrentCharWeapon(PLAYER_PED,33--[[33id country rifle]]) or isCurrentCharWeapon(PLAYER_PED,34--[[34id sniper rifle]]) then
if isLineOfSightClear(cam_x, cam_y, cam_z, colPoint.pos[1], colPoint.pos[2], colPoint.pos[3], true, true, false, true, true) then
if colPoint.entityType == 3 then
if getCharPointerHandle(colPoint.entity) ~= playerPed then
writeMemory(0xB7347A, 4, 255, 0)
end
end
end
end
end
end
end