Skip to content

Commit

Permalink
Update Server main.lua
Browse files Browse the repository at this point in the history
fix depot price sql result
  • Loading branch information
KamuiKody authored Dec 10, 2023
1 parent 3a675e3 commit e456f45
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ RegisterNetEvent('qb-garages:server:PayDepotPrice', function(data)
local Player = QBCore.Functions.GetPlayer(src)
local cashBalance = Player.PlayerData.money['cash']
local bankBalance = Player.PlayerData.money['bank']
MySQL.scalar('SELECT depotprice FROM player_vehicles WHERE plate = ?', { data.plate }, function(result)
if result then
local depotPrice = result[1].depotprice
MySQL.scalar('SELECT depotprice FROM player_vehicles WHERE plate = ?', { data.plate }, function(depotPrice)
if depotPrice then

if cashBalance >= depotPrice then
Player.Functions.RemoveMoney('cash', depotPrice, 'paid-depot')
Expand Down

0 comments on commit e456f45

Please sign in to comment.