TrailerAttached: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "Event triggered when a vehicle's trailer is attached. WARNING : If this event is not working, please use trailerAttached instead of vehicleTrailerAttach. If this resolves you...")
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Event triggered when a vehicle's trailer is attached.
Event triggered when a vehicle's trailer is attached.


WARNING : If this event is not working, please use trailerAttached instead of vehicleTrailerAttach. If this resolves your problem, please inform someone on the discord to update this page.
{{ServersideJsEvent}}


==Parameters==
{{CSharpContainer|1=
* '''vehicle'''
See [[OnVehicleTrailerChange]].
* '''trailer'''
}}


==Example==
{{JSContainer|
{{Parameters}}
* '''vehicle''': {{RageType|Vehicle}}
* '''trailer''': {{RageType|Vehicle}}
 
{{Example}}
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.events.add("vehicleTrailerAttach", (vehicle, trailer) => {
mp.events.add("trailerAttached", (vehicle, trailer) => {
  // Do what you want.
  // Do what you want.
});
});
</syntaxhighlight>
</syntaxhighlight>
}}
[[Category:Vehicle]]
[[Category:Server-side Event]]

Latest revision as of 18:58, 15 May 2024

Event triggered when a vehicle's trailer is attached.

Server-Side
Event

 JavaScript




C# Syntax


JavaScript Syntax

Parameters

  • vehicle: Vehicle
  • trailer: Vehicle

Example

mp.events.add("trailerAttached", (vehicle, trailer) => {
 // Do what you want.
});