Fix Issue Taking Payment For Furniture #74
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
You can get free furniture currently if you have enough money in your bank to pay for the cart, but not enough cash.
Details
The code in
sv_property.lua
ps-housing:server:buyFurniture
checks to make sure they either have enough cash or enough in their bank to pay for the furniture. However when it comes to taking the payment it checks if the cost is greater than the bank amount and, instead of reducing the amount of cash the player has, it tries to remove the money from the player's bank still. This means that if the settings for QBCore are to not allow negative cash and the player has enough in their bank account for the furniture and but not enough cash, it will try to take cash unsuccessfully and give them the furniture for free.UI Changes / Functionality
N/A
Testing Steps
Before the change :
qb-core/config.lua
QBConfig.Money.DontAllowMinus = { 'cash', 'crypto' }
)After the change :
Make sure QB is set up to not allow negative cash (
qb-core/config.lua
QBConfig.Money.DontAllowMinus = { 'cash', 'crypto' }
)Have no cash on your character, but plenty in the bank
Purchase furniture and note that money is now taken from your bank
Did you test the changes you made?
Did you test core functionality of the script to ensure your changes do not regress other areas?
Did you test your changes in multiplayer to ensure it works correctly on all clients?