OnTrailerUpdate
From SA-MP Wiki
Description:
This callback is called when a player sent a trailer update.
(playerid, vehicleid)
playerid | The ID of the player who sent a trailer update |
vehicleid | The Trailer being updated |
Return Values:
- 0 - Cancels any trailer updates from being sent to other players. Update is still sent to the updating player.
- 1 - Processes the trailer update as normal and synchronizes it between all players.
- It is always called first in filterscripts.
Example Usage:
public OnTrailerUpdate(playerid, vehicleid) { DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); return 0; }
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnUnoccupiedVehicleUpdate: Called when a driver-less vehicle's position is synced by a client.
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- GetVehicleTrailer: Check what trailer a vehicle is pulling.
- IsTrailerAttachedToVehicle: Check if a trailer is attached to a vehicle.
- AttachTrailerToVehicle: Attach a trailer to a vehicle.
- DetachTrailerFromVehicle: Detach a trailer from a vehicle.