Introduced in

Version:3.4

Description

Description:Sets the code that will be executed when the Systems-Menu item (for more information, see Systems Menu in the VBS3 User Manual) is activated (SYSTEM_TYPE_ITEM) or toggled (SYSTEM_TYPE_TOGGLE). The following parameters are passed as _this to the code:

For item of type SYSTEM_TYPE_ITEM:

For item of type SYSTEM_TYPE_TOGGLE:

Syntax

Syntax:[vehicle, systemItemID, code, updateClients] call fn_vbs_setSystemItemCode
Parameters:
  • vehicle: Object - The vehicle.
  • systemItemID: Number - The system item ID.
  • code: Code - The assigned code.
  • updateClients: Boolean - Update all clients (optional, default: true).
Return Value:Boolean - Returns false, if the item or the system does not exist, or the item is of the wrong type.

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:
 [player, _flares, {hint format ["Item ID %1 on vehicle %2 activated!", _this select 1, _this select 0]}] call fn_vbs_setSystemItemCode

Additional Information

See also: fn vbs getSystemItemCode, fn vbs setSystemItemCodeParam
Multiplayer:
Problems:

Notes