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




Introduced in

Version:1.50

Description

Description:Creates an IR Chemlight (only visible with NV equipment) at the selection position "attach_chemlight" (which, on vehicles that are configured for chemlights, is normally at the antenna tip). If this selection does not exist the, light is created 5m above the vehicle.

Syntax

Syntax:[vehicle, action, starton] call fn_vbs_chemlight
Parameters:
  • vehicle: Object or Group - Data Type or Array - Either a single vehicle, a group of vehicles, an array of vehicles, or an array of groups.
  • action: Number - Action(s) to execute. The available actions are:
    • 0 - Remove Device (removes the chemlight object from the vehicle).
    • 1 - Install Device (attaches a chemlight to the vehicle).
    • 2 - Query Device (returns the vehicle, if chemlight actions are available and its current state is on / off).
    • 4 - Turn On Device (turns the chemlight on).
    • 8 - Turn Off Device (turns the chemlight off).

By adding these numbers, multiple functions can be enabled. For instance:

[vehicle player, 3, true] call fn_vbs_chemlight

Installs the device, turns it on, and returns its status (1+2=3).

  • starton: Boolean - Whether to start the chemlight on for the vehicles passed to the command.
Return Value:Array - A nested array, returning one sub-array per vehicle, with the following information:
[vehicle (Object), whether it has a chemlight (Boolean), chemlight status (Number)].

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:
Install a chemlight on the player vehicle, query the object, and turn it on:
_chemStats = [vehicle player,7] call fn_vbs_chemlight; // Returns: [[WEST 1-1-A-1:1 (Dylan Young),true,1]]
Install chemlight on all vehicles in the player group and vehicle v1: 
[[group player, v1],1]] call fn_vbs_chemlight;

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes