restructure ox_lib docs

This commit is contained in:
Linden committed 2022-05-12 18:07:54 +10:00
1 parent 8081132d6f
commit a8be760943
21 files changed
+5 -30

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
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
### lib.getVehicleProperties
```lua
-- vehicle: entity
lib.getVehicleProperties(vehicle)
lib.getVehicleProperties(GetVehiclePedIsUsing(PlayerPedId()))
```
### lib.setVehicleProperties
Requires the vehicle to belong to the client. _Do not use NetworkRequestControlOfEntity_.
```lua
-- vehicle: entity
-- props: table
lib.setVehicleProperties(vehicle, props)
RegisterNetEvent('lualib:setVehicleProperties', function(netid, data)
lib.setVehicleProperties(NetToVeh(netid), data)
end)
```
#### Recommended usage
The server should tell the owner of the entity to set properties, using the following trigger.
```lua
TriggerClientEvent('lualib:setVehicleProperties', entityOwner, vehNetId, data)
```