-
Notifications
You must be signed in to change notification settings - Fork 1
Switch Action
Mike-MF edited this page Dec 30, 2022
·
7 revisions
This page will explain the usage of the Switch Action function.
/*
* Author: Mike
* Functionality for toggling switches, When "OFF" switch is red and power levels are 0, when "ON" switch is Green and power levels are either 1 or player defined.
*
* Default state is 0 (OFF) or 1 (ON)
*
* Can be checked by using getVariable on the object for switch state.
* My_Switch getVariable ["TAC_Switched", false];
*
* Call from init.sqf
*
* Arguments:
* 0: Switch <OBJECT>
* 1: Left Voltage On <NUMBER> (default: 1)
* 2: Right Voltage On <NUMBER> (default: 1)
* 3: Default state <NUMBER> (default: 0)
*
* Return Value:
* None
*
* Example:
* [My_Switch] call MFUNC(switchAction)
* [My_Switch, 0.5, 0.7] call MFUNC(switchAction)
* [My_Switch, 0.5, 0.7, 1] call MFUNC(switchAction)
*/
This function is designed for the "Transfer Switch" (Land_TransferSwitch_01_F
) object. It will increase/decrease levels on the object and switch light colours.
Switch can be checked via My_Switch getVariable ["TAC_Switched", false];
for usage elsewhere.
Call from init.sqf
Example:
[My_Switch, 0.5, 0.7] call MFUNC(switchAction);
Pages
- Home
- Your First Mission
- Creating A Mission
- Contract Missions
- Difficulty Guidelines
-
Functions Library
- Base Spectator
- Bomber
- Car Alarm
- Collect Intel
- Connect Battery To Defusable
- Contamination Gas
- Count Alive
- Dialogue
- Disable AI
- Download Intel
- Earthquake
- Enable AI
- Force Shooting
- Ground Fog
- Hunt
- Lock Doors
- Mark Buildings
- Monitor Units
- Mortar Strike
- Ping
- Players
- Reaction
- Reinforcements
- Reinforcement Waves
- Respirator Effects
- Set Sleeping
- Sound Source
- Surrender
- Switch Action
- Teleport
- Toggle Lights
- Trigger Area
- Helicopters
- Resources
- Quality Checklist
- Useful Commands
- ArmaQDL