qbcore-framework / qb-shops

Shops For QB-Core
GNU General Public License v3.0
27 stars 215 forks source link

[BUG] Notarget (E key) Selling Chips not working (Fix) #137

Closed xhackax47 closed 1 year ago

xhackax47 commented 1 year ago

Hello everyone, In client>main.lua, miss the listenForControl() function in the notarget sellchips part who cause no effect on E key pressed, to fix the bug i've added listenForControl() in sellchips part

Before

local sellChips = CircleZone:Create(vector3(Config.SellCasinoChips.coords["x"], Config.SellCasinoChips.coords["y"], Config.SellCasinoChips.coords["z"]), Config.SellCasinoChips.radius, {useZ = true})
        sellChips:onPlayerInOut(function(isPointInside)
            if isPointInside then
                inChips = true
                exports["qb-core"]:DrawText(Lang:t("info.sell_chips"))
            else
                inChips = false
                exports["qb-core"]:HideText()
            end
        end)
    end)
end

After

local sellChips = CircleZone:Create(vector3(Config.SellCasinoChips.coords["x"], Config.SellCasinoChips.coords["y"], Config.SellCasinoChips.coords["z"]), Config.SellCasinoChips.radius, {useZ = true})
        sellChips:onPlayerInOut(function(isPointInside)
            if isPointInside then
                inChips = true
                exports["qb-core"]:DrawText(Lang:t("info.sell_chips"))
                listenForControl()
            else
                inChips = false
                exports["qb-core"]:HideText()
            end
        end)
    end)
end