setElementSyncer
Server
Chooses which player syncs a ped or vehicle.
bool setElementSyncer(element element [, player|nil player = nil, bool enable = true])
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The ped or vehicle. |
| player | player|nil | The player who syncs it from now on. With nil, nobody syncs it.default nil |
| enable | bool | false stops the server from choosing anyone to sync it, and the given player is ignored.default true |
Returns
true if it applied, false if the element is not a ped or vehicle.
Example
addCommandHandler("drive", function(player)
local vehicle = createVehicle("infernus", 2495, -1687, 13.5)
setElementSyncer(vehicle, player)
end)NoteThe player only starts syncing if it already knows the element.