mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 22:21:48 +00:00
1.4 KiB
1.4 KiB
Mostly follows the format used by ESX and QBCore, with extra data such as damaged/missing props.
https://github.com/overextended/ox_lib/blob/master/resource/vehicleProperties/client.lua#L5
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
lib.getVehicleProperties
lib.getVehicleProperties(vehicle)
- vehicle:
entity
lib.getVehicleProperties(GetVehiclePedIsUsing(PlayerPedId()))
import lib from '@overextended/ox_lib/client'
lib.getVehicleProperties(GetVehiclePedIsUsing(PlayerPedId()))
lib.setVehicleProperties
Requires the vehicle to belong to the client. Do not use NetworkRequestControlOfEntity.
lib.setVehicleProperties(vehicle, props)
- vehicle:
entity - props:
table(object)
RegisterNetEvent('ox_lib:setVehicleProperties', function(netid, data)
lib.setVehicleProperties(NetToVeh(netid), data)
end)
import lib from '@overextended/ox_lib/client'
onNet('ox_lib:setVehicleProperties', (netid, data) => {
lib.setVehicleProperties(NetToVeh(netid), data)
})
Recommended usage
The server should tell the owner of the entity to set properties, using the following trigger.
TriggerClientEvent('ox_lib:setVehicleProperties', entityOwner, vehNetId, data)