Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:17.2.0

Description

Description: Terminates trailer hitching for given parent and child objects.

Syntax

Syntax: [parent, child, mode, exceptions, spawned] call fn_tow_stopHitch
Parameters:
  • parent: Object - Parent vehicle / object to tow with.
  • child: Object - Child vehicle / object to disconnect (default: objNull - automatic).
  • mode: Number - (Optional) Determines the script mode to unhitch in. The supported values are: 0 - timed, 1 - instant (default: 0 - timed).
  • exceptions: Boolean - (Optional) Determines whether the function should throw an exception upon an error (default: false).
  • spawned: Boolean - (Optional) Determines whether the function is safe for running timed code, including waitUntil and sleep (default: false).
Return Value: Nothing

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples: Make tractor stop hitching trailer:
[tractor, trailer] call fn_tow_stopHitch
Make tractor stop hitching trailer instantly:
[tractor, trailer, 1] call fn_tow_stopHitch
Make tractor stop hitching trailer instantly, print exceptions using hint:
try {[tractor, trailer, 1, true] call fn_tow_stopHitch} catch {hintC str _exception}

Additional Information

See also: fn tow towParent, fn tow towChild, fn tow canTow, fn tow canHitch, fn tow startTow, fn tow startHitch, fn tow startRopeTow, fn tow stopTow, fn tow stopRopeTow, fn tow getRopeTowConnections, fn tow getAvailableTowPoints, fn tow setPointLocked
Multiplayer:Can be applied to remote objects, the locality of the arguments does not matter.
Problems: 

Notes