OnTrailerUpdate

From SA-MP Wiki

Jump to: navigation, search


This callback was added in SA-MP 0.3z R4 and will not work in earlier versions!


Description:

This callback is called when a player sent a trailer update.


Parameters:
(playerid, vehicleid)
playeridThe ID of the player who sent a trailer update
vehicleidThe 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.


Image:32px-Circle-style-warning.png

Warning

Known Bug(s): This public is not called for trains.


Image:32px-Circle-style-warning.png

Important
Note

  • This callback is called very frequently per second per trailer. You should refrain from implementing intensive calculations or intensive file writing/reading operations in this callback.


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.


Related Functions

The following functions might be useful, as they're related to this callback in one way or another.

Personal tools
Navigation
Toolbox