RU/onTrailerAttach: Difference between revisions
Jump to navigation
Jump to search
(Created page with '__NOTOC__ {{Server event}} This event is triggered when a trailer is attached to a truck. ==Parameters== <syntaxhighlight lang="lua"> vehicle theTruck </syntaxhighlight> *'''theTruck''': The truck vehi…') |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server event}} | {{RU/Server event}} | ||
This event is triggered when a trailer is attached to a truck. | This event is triggered when a trailer is attached to a truck. | ||
Revision as of 15:39, 6 March 2010
This event is triggered when a trailer is attached to a truck.
Parameters
vehicle theTruck
- theTruck: The truck vehicle that got attached to this trailer
Source
The source of this event is the trailer vehicle that the truck got attached to.
Cancel effect
If this event is canceled, the trailer will detach from the truck again.
Example
This example removes a trailer from the truck it is attached to. Good if you do not want people attaching trailers to vehicles
function detachTrailer(theTruck) detachTrailerFromVehicle(theTruck, source) --detach the newly attached trailer end addEventHandler("onTrailerAttach", getRootElement(), detachTrailer)
See Also
Vehicle events
- onTrailerAttach
- onTrailerDetach
- onVehicleDamage
- onVehicleEnter
- onVehicleExit
- onVehicleExplode
- onVehicleRespawn
- onVehicleStartEnter
- onVehicleStartExit
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled