From 5b5be014579f6a431b3d65486bd3ac6b30b493cf Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sat, 9 Mar 2019 16:56:58 +0100 Subject: [PATCH] Fixed vonurability --- client/main.lua | 1 - server/main.lua | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index 488de03d..322c0884 100644 --- a/client/main.lua +++ b/client/main.lua @@ -65,7 +65,6 @@ function OpenBoatShop(shop) local vehicle = GetVehiclePedIsIn(playerPed, false) local props = ESX.Game.GetVehicleProperties(vehicle) props.plate = plate - props.modelAlt = data.current.model ESX.TriggerServerCallback('esx_boat:buyBoat', function (bought) diff --git a/server/main.lua b/server/main.lua index 20adc92b..78f05d7c 100644 --- a/server/main.lua +++ b/server/main.lua @@ -18,9 +18,7 @@ end ESX.RegisterServerCallback('esx_boat:buyBoat', function(source, cb, vehicleProps) local xPlayer = ESX.GetPlayerFromId(source) - local price = getPriceFromModel(vehicleProps.modelAlt) - - vehicleProps.modelAlt = nil + local price = getPriceFromModel(vehicleProps.model) -- vehicle model not found if price == 0 then @@ -103,7 +101,7 @@ end) function getPriceFromModel(model) for i=1, #Config.Vehicles, 1 do - if Config.Vehicles[i].model == model then + if GetHashKey(Config.Vehicles[i].model) == model then return Config.Vehicles[i].price end end