Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client/main): blips #25

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ local blips = {}

local function takeCoral(coralIndex)
local times = math.random(2, 5)
FreezeEntityPosition(cache.ped, true)

if lib.progressBar({
duration = times * 1000,
label = Lang:t('info.collecting_coral'),
Expand All @@ -33,9 +31,6 @@ local function takeCoral(coralIndex)
TriggerEvent('qbx_diving:client:coralTaken', coralIndex)
TriggerServerEvent('qbx_diving:server:takeCoral', coralIndex)
end

ClearPedTasks(cache.ped)
FreezeEntityPosition(cache.ped, false)
end

local function clearCoralZones()
Expand All @@ -60,8 +55,8 @@ local function clearAreaBlips()
blips = {}
end

local function createAreaBlips(area)
local coords = Config.CoralLocations[area].blip
local function createAreaBlips(areaIndex)
local coords = Config.CoralLocations[areaIndex].blip
local radiusBlip = AddBlipForRadius(coords.x, coords.y, coords.z, 100.0)
SetBlipRotation(radiusBlip, 0)
SetBlipColour(radiusBlip, 47)
Expand Down Expand Up @@ -131,7 +126,7 @@ local function setDivingLocation(areaIndex, pickedUpCoralIndexes)
createCoralZones(areaIndex, pickedUpCoralIndexes)

clearAreaBlips()
blips = createAreaBlips()
blips = createAreaBlips(areaIndex)
end

local function sellCoral()
Expand Down
Loading