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



Introduced in

Version:3.10

Description

Description:Returns the appropriate crew animation for a specific vehicle position. The function first searches for an animation for the turned-in position. If no such animation is available, then the turned-out animation is returned.

Syntax

Syntax:[unit] call fn_vbs_getCrewAction
Parameters:
  • unit: Object - Unit currently occupying a vehicle.
Return Value:String - Animation class name, or empty string, if not in vehicle.

Alternative Syntax

Syntax:[vehicle, crewpos, index] call fn_vbs_getCrewAction
Parameters:
  • unit: Object - Vehicle (empty or occupied).
  • crewpos: String - Crew position. Can be "DRIVER", "GUNNER" or "CARGO".
  • index: Number or Array - For cargo positions, an index number must be provided. For gunners, a turret path.
Return Value:String - Animation class name, or empty string, if no valid match found.

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:
_anim = [player] call fn_vbs_getCrewAction;
_anim = [tank1,"DRIVER"] call fn_vbs_getCrewAction;
_anim = [player,"CARGO",2] call fn_vbs_getCrewAction;
_anim = [player,"GUNNER",[0]] call fn_vbs_getCrewAction;

Additional Information

See also: getCrewPos
Multiplayer:
Problems:

Notes