mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
refactor(client/vehicleProperties): return true if client owns entity
Technically closer to the previous behaviour.
This commit is contained in:
@@ -284,7 +284,7 @@ end
|
||||
---@param vehicle number
|
||||
---@param props VehicleProperties
|
||||
---@param fixVehicle? boolean Fix the vehicle after props have been set. Usually required when adding extras.
|
||||
---@return boolean?
|
||||
---@return boolean isEntityOwner True if the entity is networked and the client is the current entity owner.
|
||||
function lib.setVehicleProperties(vehicle, props, fixVehicle)
|
||||
if not DoesEntityExist(vehicle) then
|
||||
error(("Unable to set vehicle properties for '%s' (entity does not exist)"):format(vehicle))
|
||||
@@ -637,5 +637,5 @@ function lib.setVehicleProperties(vehicle, props, fixVehicle)
|
||||
SetVehicleFixed(vehicle)
|
||||
end
|
||||
|
||||
return true
|
||||
return not NetworkGetEntityIsNetworked(vehicle) or NetworkGetEntityOwner(vehicle) == cache.playerId
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user