cl_utils.lua

local sleep = 1000
CreateThread(function()
    if Config.Interaction == "drawtext" then
        while true do
            Wait(sleep)
            local foundzone = false
            if GetDistanceBetweenCoords(vec3(Config.SellCoords.coords.x, Config.SellCoords.coords.y, Config.SellCoords.coords.z), GetEntityCoords(PlayerPedId()), true) < 10 then
                foundzone = true
            end

            if GetDistanceBetweenCoords(vec3(Config.JobCoords.coords.x, Config.JobCoords.coords.y, Config.JobCoords.coords.z), GetEntityCoords(PlayerPedId()), true) < 10 then
                foundzone = true
            end

            if foundzone then
                sleep = 1
                if GetDistanceBetweenCoords(vec3(Config.SellCoords.coords.x, Config.SellCoords.coords.y, Config.SellCoords.coords.z), GetEntityCoords(PlayerPedId()), true) < 2 then
                    Draw3DText({
                        text = "[E] " .. Config.locales[Config.Locale]["game"]["access_sell"],
                        coords = vec3(Config.SellCoords.coords.x, Config.SellCoords.coords.y, Config.SellCoords.coords.z) + vec3(0, 0, 1.0)
                    })
                    if IsControlJustReleased(0, 38) then
                        TriggerEvent('ak4y-shredding:SellMenu')
                    end
                end
                if GetDistanceBetweenCoords(vec3(Config.JobCoords.coords.x, Config.JobCoords.coords.y, Config.JobCoords.coords.z), GetEntityCoords(PlayerPedId()), true) < 2 then
                    Draw3DText({
                        text = "[E] " .. Config.locales[Config.Locale]["game"]["access_menu"],
                        coords = vec3(Config.JobCoords.coords.x, Config.JobCoords.coords.y, Config.JobCoords.coords.z) + vec3(0, 0, 1.0)
                    })
                    if IsControlJustReleased(0, 38) then
                        TriggerEvent('ak4y-shredding:OpenMenu')
                    end
                end
            else
                sleep = 1000
            end
        end
    end
end)

RegisterNetEvent('ak4y-shredding-DisableGpsItem', function()
    if missionstarted and not disabledgps then
        TriggerServerEvent('ak4y-shredding:RemoveGpsRemover')
        TriggerEvent('mhacking:show')
        TriggerEvent('mhacking:start', math.random(6, 7), math.random(15, 30), onHackDone)
    end
end)

onHackDone = function(success)
    TriggerEvent('mhacking:hide')
    if not success then return end
    TriggerServerEvent('ak4y-shredding:DisableBlip', LobbyData) -- don't change
end

Last updated