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



Introduced in

Version:17.2.0

Description

Description: Checks if a parent object can tow a child object using a given towing mode.

Syntax

Syntax: [parent, child, type, length] call fn_tow_canTow
Parameters:
  • parent: Object - Parent vehicle / object to tow with.
  • child: Object - Vehicle to be towed.
  • type: String - (Optional) Towing mode. The supported values are: "TOWBAR", "CUSTOM", "ROPETOW" (default: "TOWBAR").
  • length: Number - (Optional) Maximum rope length (default: -1 automatic, depends on type).
Return Value: Boolean - Returns true when can tow, false when cannot.

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: Check if vehicle1 can tow vehicle2 using towbar:
[vehicle1, vehicle2] call fn_tow_canTow
Check if vehicle1 can tow vehicle2 using custom towing feature (typical for wreckers):
[vehicle1, vehicle2, "CUSTOM"] call fn_tow_canTow
Check if vehicle1 can tow vehicle2 using ropes no longer than 10 meters:
[vehicle1, vehicle2, "ROPETOW", 10] call fn_tow_canTow

Additional Information

See also: fn tow towParent, fn tow towChild, fn tow canHitch, fn tow startTow, fn tow startHitch, fn tow startRopeTow, fn tow stopTow, fn tow stopHitch, 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