qb-core icon indicating copy to clipboard operation
qb-core copied to clipboard

Remove inventory code from the core

Open BerkieBb opened this issue 2 years ago • 9 comments

Describe Pull request This removes all inventory code from the core and changes it to the code that is handled by the inventory instead,I have tested this but probably not thorougly enough, so please test this if you come across this.

This also adds the QBCore:Server:PlayerUnloaded event to be the same as the QBCore:Server:PlayerLoaded event but for logging out. But instead of sending player data, it sends source as the playerdata is not loaded at that point anymore.

Questions (please complete the following information):

  • Have you personally loaded this code into an updated qbcore project and checked all it's functionality? [yes] (Be honest)
  • Does your code fit the style guidelines? [yes]
  • Does your PR fit the contribution guidelines? [yes]

BerkieBb avatar Aug 10 '22 17:08 BerkieBb

Untitled

Receiving a "No Such Export CreateUsableItem" error

Lavarris avatar Aug 12 '22 00:08 Lavarris

You need to make sure qb-inventory exclusively starts after qb-core

BerkieBb avatar Aug 12 '22 00:08 BerkieBb

I can confirm QB-Core is started before QB-Inventory Untitled

Lavarris avatar Aug 12 '22 00:08 Lavarris

That's not what I meant

BerkieBb avatar Aug 12 '22 00:08 BerkieBb

I meant qb-inventory needs to start right after qb-core

BerkieBb avatar Aug 12 '22 00:08 BerkieBb

It is working now, thank you!

Lavarris avatar Aug 12 '22 00:08 Lavarris

Please do test it thorougly if you can, if you have any more issues, please come here so I can fix them or help you fix them

BerkieBb avatar Aug 12 '22 00:08 BerkieBb

Here is an additional error located Untitled

Lavarris avatar Aug 12 '22 00:08 Lavarris

Alright, I'll take a look tomorrow

BerkieBb avatar Aug 12 '22 00:08 BerkieBb

Fixed the issue in the qb-inventory PR

BerkieBb avatar Aug 12 '22 13:08 BerkieBb

Good job that did correct that error! A server side error has now presented itself. When I go to use an item such as wash money the message I receive is "You have no marked money" which I do. I think this could be related the "CreateUsableItem" function or the "GetItem" function as it seems it can't find or "get" the item. Untitled

Lavarris avatar Aug 13 '22 02:08 Lavarris

No it's actually because that's one of the functions without backwards compatibility, you'd just need to change QBCore.Player.GetSlotsByItem to exports['qb-inventory']:GetSlotsByItem to fix it

BerkieBb avatar Aug 13 '22 02:08 BerkieBb

@Lavarris has everything been good so far? No issues anymore?

BerkieBb avatar Aug 15 '22 10:08 BerkieBb

The only real issue we are having is with encrypted scripts we have purchased. We can't seem to change the natives to updated exports you created. Anyway to make this in some way backwards compatible for that reason?

Lavarris avatar Aug 16 '22 15:08 Lavarris

I'll add it later

BerkieBb avatar Aug 17 '22 09:08 BerkieBb

That last commit is meant to be named SetField and SetMethod

BerkieBb avatar Aug 18 '22 15:08 BerkieBb

Thanks for the update, the character selection screen within qb-mulitcharacters is not displaying. No errors are presented in the server console or client console.

Lavarris avatar Aug 18 '22 19:08 Lavarris