jimathy / jim-mining

FiveM QBCore Script for Mining
158 stars 108 forks source link

no mining option on rocks. #41

Open FrequencyRoleplay opened 1 year ago

FrequencyRoleplay commented 1 year ago

I even tried updating qb target.... I can target ped shop no problem but the ore/rocks dont show any option to mine like they used to.

been like this for over a month now. SOS

FrequencyRoleplay commented 1 year ago

going to an older qb-target fixed this for me.

Schlingelberger commented 1 year ago

hey guy

use this it works https://drive.google.com/file/d/1aB6Nbq2kSpj5-5oGTmFKaDYig5UGH7Xq/view

SlugTeamSix commented 1 year ago

Editing this post and removing all my debugging guesses for clarity.

This issue is caused by having updating qb-target from the version which uses function ItemCount to check if data.item is true, to the version which uses function ItemCheck. The newer qb-target version does ItemCheck = QBCore.Functions.HasItem instead of the old code where it actually grabbed your playerdata.items inside of qb-target.

This is where the problem begins, presumably if you are updating from an older qb-target you have an older qb-core. On an old core HasItem only supports one item at a time and doesn't play nice with multiple item checks.

This situation can be fixed and still allow you to use an updated qb-target by updating your qb-core HasItem function (specifically the one on the client side is needed for this script). However be aware, the new HasItem function in qbcore just triggers an export in qb-inventory, so if your inventory is old as well you'll need to update by adding in the HasItem function and export, then adding the event to the core.

And then it all works as intended!