Project-Sloth / ps-fuel

A NoPixel inspired functionality fuel system that uses PolyZones that target specific areas that allow you to have the abilitity to refuel your vehicles.
GNU General Public License v3.0
63 stars 48 forks source link

Card Payment Doesn't Work #40

Closed ShortKeeper closed 1 year ago

ShortKeeper commented 1 year ago

I noticed when selecting to use card it still only checks if you have enough cash instead of checking your bank account. If this could get fixed my server and I would be very happy! For now we will just let everyone know that the card function is not working properly.

R3pcom commented 1 year ago

Client.lua line 470 checks whether the players cash balance is lower than the refuel cost. This is where card payments break, because the script never even checks the player's bank balance.

if QBCore.Functions.GetPlayerData().money['cash'] <= refillCost then should be if QBCore.Functions.GetPlayerData().money[paymentMethod] < refillCost then

Also replacing <= with < as there is no reason why refueling should fail if the balance is equal to the refill cost. The player just ends up with 0$ if this is the case.