From 9bc37b461de2146ec8f4c43c7b2adc6d3f90e87f Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sat, 9 Jul 2022 03:39:42 +1000 Subject: [PATCH] tweak(vehicleProperties): allow local entities Local entities (not networked) would fail the check for NetworkGetEntityOwner. Also fix the error messages, which referenced the wrong variable. --- resource/vehicleProperties/client.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/vehicleProperties/client.lua b/resource/vehicleProperties/client.lua index 56c0e4a..69308d5 100644 --- a/resource/vehicleProperties/client.lua +++ b/resource/vehicleProperties/client.lua @@ -171,8 +171,8 @@ end ---@param vehicle number Entity handle ---@param props table Properties function lib.setVehicleProperties(vehicle, props) - if not DoesEntityExist(vehicle) then error(("Unable to set vehicle properties for '%s' (entity does not exist)"):format(entity)) end - if NetworkGetEntityOwner(vehicle) ~= PlayerId() then error(("Unable to set vehicle properties for '%s' (client is not entity owner)"):format(entity)) end + if not DoesEntityExist(vehicle) then error(("Unable to set vehicle properties for '%s' (entity does not exist)"):format(vehicle)) end + if NetworkGetEntityIsNetworked(vehicle) and NetworkGetEntityOwner(vehicle) ~= cache.playerId then error(("Unable to set vehicle properties for '%s' (client is not entity owner)"):format(vehicle)) end local colorPrimary, colorSecondary = GetVehicleColours(vehicle) local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)