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




Introduced in

Version:1.46

Description

Description:Allows creating, attaching, and manipulating a CREW device with a vehicle, using script files and the Developer Console.

This function adds actions to specific seats that allow the user to change the state of the CREW device.
The available actions are:

  • 0 - Remove Device (removes the CREW antenna and device from the vehicle).
  • 1 - Install Device (attaches a CREW antenna and device to the vehicle).
  • 2 - Query Device (returns the device parameters and its current state: On / Off / Damaged).
  • 4 - Turn On Device (turns the device on, and begins jamming IEDs within its radius).
  • 8 - Turn Off Device(turns the device off, and stops jamming IEDs within its radius).
  • 16 - Damage Device (removes the action to jam from all action seats).

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

[vehicle player, 7] call fn_vbs_vehicleECM would install the device, turn it on and return its status (1+2+4=7).

Syntax

Syntax:[vehicle, action, visible, action_seats, viewing_seats] call fn_vbs_vehicleECM
Parameters:
  • vehicle: Object - Vehicle to attach the CREW device to.
  • action: Number - Action(s) to execute. The available actions are listed in the description section.
  • visible: Boolean - Indicates whether the device shows the jamming radius of the vehicle, when it is on and not damaged.
  • action_seats: Array of Number - Indexes of vehicle seats that have the CREW actions available to them. These seats are automatically treated as if they were in the viewing_seats array too.
  • viewing_seats: Array of Number - Indexes of vehicle seats that are able to see the onscreen display, showing the state of the CREW device.
Return Value:Array - Passed parameters and device state.

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 CREW device on the players vehicle, turn it off, and do not show the jam radius. Give the actions to seats 11, 12 and let seat 13 see the state:
_crewStats = [vehicle player,9,false,[11,12],[13]] call fn_vbs_vehicleECM;

If nil is passed as the 3rd parameter, the function performs the crew creation, as if it is done using the CREW Editor Object.

[vehicle player,1,nil] call fn_vbs_vehicleECM; // Passing nil gives all the seats CREW actions, and does not show the HUD in any of the seats.

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes