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

Feat: Money as Item #1152

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Cocodrulo
Copy link
Contributor

@Cocodrulo Cocodrulo commented Dec 9, 2024

Description

I don't know why QBCore has never include this feature widely used by RP servers. Some inventories include this feature, but I don't think it is a job for inventory, I believe it is for the core framework of the server. The only thing to take into account is that I'm using a function exported from the qb-inventory, so other inventories should adapt to this change and provide compativility.

Open to suggestions!!

Did not see this suggestion previously, but it seems this aproach this issue/suggestion: #930

Checklist

  • I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • My code fits the style guidelines.
  • My PR fits the contribution guidelines.

@Cocodrulo Cocodrulo mentioned this pull request Dec 9, 2024
@Cocodrulo Cocodrulo changed the title Money as Item Feat: Money as Item Dec 9, 2024
Copy link
Contributor

@Jamie9192 Jamie9192 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the way you approached having this as a config option, defaulting to false.

The way the player.lua was implemented, Would be much better broken out to a function to prevent the repeated code.

@Cocodrulo
Copy link
Contributor Author

Like the way you approached having this as a config option, defaulting to false.

The way the player.lua was implemented, Would be much better broken out to a function to prevent the repeated code.

Done!! Thanks for the comment

@Cocodrulo Cocodrulo requested a review from Jamie9192 December 10, 2024 20:50
@itsExpress
Copy link

Curious, how does this handle negative amounting?
For example, if you have cash to allow -500, would it add money then remove it? or would it just allow you to go -500 and never recoup the costs?

@Cocodrulo
Copy link
Contributor Author

Well I think that if a server wants its money as item, they would not let that account to be in negative terms. But in case it does, it is all handled by the inventory script. It is how this resource handle it what will determine the outcome. I don't know if I have explained myself correctly. But I don't think modern inventories allow negative quantities of items.

@Cocodrulo
Copy link
Contributor Author

I have test this in my server and I've solved some errors, now works fine

@robzZ-glitch
Copy link

I tested if the infinite error is solved and the error that you couldn't put money in trunks and other inventories and they are solved everything works fine for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants