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

Fix Issue Taking Payment For Furniture #74

Conversation

iLickPandas21
Copy link
Contributor

@iLickPandas21 iLickPandas21 commented Jul 30, 2023

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 :

  • 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 no money is taken

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?

server/sv_property.lua Outdated Show resolved Hide resolved
@MonkeyWhisper
Copy link
Member

SXETIKOS — Today at 3:36 PM
Works fine

0 cash - 5k on bank charge from bank
1k cash - 5k on bank charge from bank
1k cash - 0 on bank charge from cash

@ImXirvin
Copy link
Contributor

ImXirvin commented Aug 2, 2023

Yep, I don't know why I didn't catch this lol. Thank you

@BackSH00TER BackSH00TER merged commit ca82d58 into Project-Sloth:main Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants