overextended / ox_doorlock

https://overextended.dev/ox_doorlock
GNU General Public License v3.0
153 stars 139 forks source link

cant lockpick doors #160

Closed jaylac2000 closed 1 year ago

jaylac2000 commented 1 year ago

It wont let me lockpick door, am I doing something wrong?

QBCore. latest ox_lib, sql and doorlock

https://medal.tv/games/gta-v/clips/1sBGy6nXmm0-U-/d1337pT5ZABD?invite=cr-MSx6S3ksMTQ1Mzk3NDEs

FortifiedGrizzly commented 1 year ago

I am having exactly the same issue! I don't think it is your side buddy.

LukeWasTakenn commented 1 year ago

I've tested with ox_core and ox_inventory and it seems to be working as expected.

Can I see your door settings?

FortifiedGrizzly commented 1 year ago

Ahhh, that might be the problem? I am using ps-inventory?

https://imgur.com/a/r6HZ1Vr is this enough settings?

LukeWasTakenn commented 1 year ago

Well ps-inventory is just reskinned qb-inventory, but you wouldn't be getting the target option if the item you didn't have the item 🤔

I'm assuming there's no other settings on the door than the ones you showed...?

This is the function that checks whether the door can be opened or not. https://github.com/overextended/ox_doorlock/blob/a7dea12252c9ee53772979e2bb0a84b70acd7023/server/main.lua#L196-L234

Particularly this check for the lockpick item: https://github.com/overextended/ox_doorlock/blob/a7dea12252c9ee53772979e2bb0a84b70acd7023/server/main.lua#L212-L214

So I'd recommend leaving some prints and seeing what the DoesPlayerHaveItem function returns, as it could be that it's not actually finding the item server-side in your inventory for some reason.

FortifiedGrizzly commented 1 year ago

There is a few more settings, but I thought these were the only important ones. I added some print in, so that when lockpick was finsihed, it printed "lockpick found" and it printed this as intended. image image image image

LukeWasTakenn commented 1 year ago

Instead of printing "Lockpick found" do print(DoesPlayerHaveItem(player, Config.LockpickItems), Config.LockpickItems)

FortifiedGrizzly commented 1 year ago

When I use that print, I am getting this error

[ script:ox_doorlock] nil table: 000002434C86A580

LukeWasTakenn commented 1 year ago

Right, so it seems that the item check on in your inventory returns that there are no lockpick items found, not sure if it's qb-inventory issue or just ps-inventory issue, though I wouldn't be surprised if it was the latter.

https://github.com/overextended/ox_doorlock/blob/a7dea12252c9ee53772979e2bb0a84b70acd7023/server/framework/qb-core.lua#L17-L47

jaylac2000 commented 1 year ago

Ahhh, that might be the problem? I am using ps-inventory?

https://imgur.com/a/r6HZ1Vr is this enough settings?

I'm using ps-inventory also

FortifiedGrizzly commented 1 year ago

Ahhh, that might be the problem? I am using ps-inventory? https://imgur.com/a/r6HZ1Vr is this enough settings?

I'm using ps-inventory also

Looks like a ps-inventory issue! That kinda sucks! but I can live with it, if there is no fix :)

thelindat commented 1 year ago

Try with https://github.com/overextended/ox_doorlock/commit/7a6580a0eaee1176cfc98f5797c7767310adfe1c

FortifiedGrizzly commented 1 year ago

Issue has been fixed! thank you TheLindat!