script_name("CamHack")
script_author("sanek a.k.a Maks_Fender, edited by ANIKI")
require "lib.moonloader"
local mad = require "MoonAdditions"

function main()
flymode = 0
speed = 1.0
radarHud = 0
time = 0
keyPressed = 0

while true do
wait(0)
time = time + 1

-- Trigger to activate fly mode
if isKeyDown(VK_C) and isKeyDown(VK_1) then
if flymode == 0 then
displayRadar(false)
displayHud(false)
posX, posY, posZ = getCharCoordinates(playerPed)
angZ = getCharHeading(playerPed)
angY = 0.0
setFixedCameraPosition(posX, posY, posZ, 0.0, 0.0, 0.0)
lockPlayerControl(true)
flymode = 1
end
end

-- Fly mode logic
if flymode == 1 and not sampIsChatInputActive() and not isSampfuncsConsoleActive() then
offMouX, offMouY = getPcMouseMovement()
angZ = (angZ + offMouX * 0.1) % 360
angY = clamp(angY - offMouY * 0.1, -89, 89)

local radZ = math.rad(angZ)
local radY = math.rad(angY)
local forwardX = math.cos(radY) * math.sin(radZ)
local forwardY = math.cos(radY) * math.cos(radZ)
local forwardZ = -math.sin(radY)

-- Display debug text
drawDebugText(posX, posY, posZ, angZ, angY)

-- Movement controls
if isKeyDown(VK_W) then
posX = posX + forwardX * speed
posY = posY + forwardY * speed
posZ = posZ + forwardZ * speed
end
if isKeyDown(VK_S) then
posX = posX - forwardX * speed
posY = posY - forwardY * speed
posZ = posZ - forwardZ * speed
end

if isKeyDown(VK_A) then -- Move Left
posX = posX - forwardY * speed
posY = posY + forwardX * speed
end
if isKeyDown(VK_D) then -- Move Right
posX = posX + forwardY * speed
posY = posY - forwardX * speed
end

if isKeyDown(VK_SPACE) then
posZ = posZ + speed
end
if isKeyDown(VK_SHIFT) then
posZ = posZ - speed
end

setFixedCameraPosition(posX, posY, posZ, 0.0, 0.0, 0.0)
pointCameraAtPoint(posX + forwardX, posY + forwardY, posZ + forwardZ, 2)

-- Radar and HUD toggle
if keyPressed == 0 and isKeyDown(VK_F10) then
keyPressed = 1
toggleRadarHud()
end
if wasKeyReleased(VK_F10) and keyPressed == 1 then keyPressed = 0 end

-- Speed control
speed = handleSpeedControl(speed)

-- Exit fly mode
if isKeyDown(VK_C) and isKeyDown(VK_2) then
disableFlyMode()
flymode = 0
end
end
end
end

-- Clamp function to restrict values between min and max
function clamp(value, min, max)
return math.max(min, math.min(value, max))
end

-- Draw detailed debug text on screen with enhanced styling
function drawDebugText(posX, posY, posZ, angZ, angY)
local text = string.format(
"><==== Camera Debug Information ====<~n~" ..
"Position:~n~" ..
" X: ~y~%.2f ~w~| Y: ~y~%.2f ~w~| Z: ~y~%.2f~n~" ..
"~n~Angles:~n~" ..
" Z: ~y~%.2f ~w~degrees~n~" ..
" Y: ~y~%.2f ~w~degrees~n~" ..
"~n~Speed:~n~" ..
" Current: ~g~%.2f ~w~units/sec~n~" ..
"~n~Frame Time: ~o~%d ~w~frames since last reset~n~" ..
">~n~",
posX, posY, posZ,
angZ,
angY,
speed,
time
)
mad.draw_text(text, 30, 100, mad.font_style.BEFORE_TEXT, 0.5, 0.5, mad.font_align.LEFT, 9999, true, false,
255, 255, 255, 255, 1, 2, 0, 0, 0, 150)
end

-- Toggle radar and HUD visibility
function toggleRadarHud()
if radarHud == 0 then
displayRadar(true)
displayHud(true)
radarHud = 1
else
displayRadar(false)
displayHud(false)
radarHud = 0
end
end

-- Handle speed control
function handleSpeedControl(speed)
if isKeyDown(187) then
speed = speed + 0.1
end
if isKeyDown(189) then
speed = clamp(speed - 0.1, 0.1, 10.0)
end
printStringNow(string.format("Speed: %.2f", speed), 1000)
return speed
end

-- Disable fly mode
function disableFlyMode()
displayRadar(true)
displayHud(true)
radarHud = 0
restoreCameraJumpcut()
setCameraBehindPlayer()
lockPlayerControl(false)
end

local sampev = require "lib.samp.events"

function sampev.onPlayerChatBubble(id, col, dist, dur, msg)
if flymode == 1 then
return {id, col, 1488, dur, msg}
end
end


добавь отображение позиции куда смотрит камера и сделай отображение текста в ярко розовых и немношка голубых тонах