Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        local playerPed = PlayerPedId()
        local playerCoords = GetEntityCoords(playerPed)
       
        -- Kırmızı bölgenin merkez koordinatları
        local zoneCenter = vector3(x, y, z)
        local zoneRadius = 100.0
       
        DrawMarker(1, zoneCenter.x, zoneCenter.y, zoneCenter.z - 1.0, 0, 0, 0, 0, 0, 0, zoneRadius * 2.0, zoneRadius * 2.0, 2.0, 255, 0, 0, 100, false, true, 2, false, nil, nil, false)
       
   
        if #(playerCoords - zoneCenter) < zoneRadius then
            DrawText3D(playerCoords.x, playerCoords.y, playerCoords.z, "Tehlikeli bölgedesiniz!")
        end
    end
end)
function DrawText3D(x, y, z, text)
    local onScreen, _x, _y = World3dToScreen2d(x, y, z)
    local px, py, pz = table.unpack(GetGameplayCamCoords())
    SetTextScale(0.35, 0.35)
    SetTextFont(4)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(1)
    AddTextComponentString(text)
    DrawText(_x, _y)
    local factor = (string.len(text)) / 370
    DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 68)
end