mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
Basic docs for all of ox_lib
This commit is contained in:
1 parent
2350a5bfc1
commit
fd5ccc4964
14 files changed
+206
-64
No files matched your search
@@ -0,0 +1,29 @@
|
||||
# Vehicle Properties
|
||||
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/entities/client/vehicleproperties.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)
|
||||
```
|
||||
Reference in new issue
Block a user