Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix (server) prevent error and nil val
  • Loading branch information
renzuzu committed Aug 12, 2021
1 parent 0fa29aa commit b9be299
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/server.lua
Expand Up @@ -6,10 +6,11 @@ AddEventHandler('renzu_vehicleshop:GetAvailableVehicle', function(shop)
local src = source
local xPlayer = ESX.GetPlayerFromId(src)
local identifier = xPlayer.identifier
local shop = shop or 'pdm'
if Config.Mysql == 'mysql-async' then
Owned_Vehicle = MySQL.Sync.fetchAll('SELECT * FROM vehicles WHERE shop = @shop', {['shop'] = shop})
Owned_Vehicle = MySQL.Sync.fetchAll('SELECT * FROM vehicles WHERE shop = @shop', {['@shop'] = shop})
--TriggerClientEvent('table',-1,Owned_Vehicle)
if #Owned_Vehicle > 0 then
if Owned_Vehicle[1] then
Owned_Vehicle = Owned_Vehicle
else
Owned_Vehicle = VehicleShop[shop].shop
Expand Down Expand Up @@ -314,4 +315,4 @@ function Buy(result,xPlayer,model, props, payment, job, type, garage)
while not fetchdone do Wait(0) end
print("SENDING TO CLIENT SUCCESS")
return bool
end
end

0 comments on commit b9be299

Please sign in to comment.