BIS fnc switchLamp: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (missing bracket in example)
Line 44: Line 44:
[[while]] {[[player]] [[distance]] _lamp < 200} [[do]]
[[while]] {[[player]] [[distance]] _lamp < 200} [[do]]
{
{
[_lamp,[[selectRandom]] [ [[true]] , [[false]] ] [[call]] '''BIS_fnc_switchLamp''';
[_lamp, [[selectRandom]] [ [[true]], [[false]] ]] [[call]] '''BIS_fnc_switchLamp''';
[[sleep]] 0.1 + [[random]] 0.5;
[[sleep]] 0.1 + [[random]] 0.5;
};//Simulates a damaged street light
};//Simulates a damaged street light

Revision as of 08:06, 28 January 2018

Hover & click on the images for description

Description

Description:
Switch streetlamp on/off
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[_object, _state] call BIS_fnc_switchLamp;
Parameters:
Object - Street Lamp
Bool - State: True to turn lamp on, false to turn it off
Return Value:
Nothing

Examples

Example 1:
{ [_x,false] call BIS_fnc_switchLamp; false; } count nearestObjects [ player,["Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F"],200];//Switches all lamps in a radius of 200 off
Example 2:
spawn { private _lamp = param [0, objNull,[ objNull ]]; while {player distance _lamp < 200} do { [_lamp, selectRandom [ true, false ]] call BIS_fnc_switchLamp; sleep 0.1 + random 0.5; };//Simulates a damaged street light };

Additional Information

See also:
SEEALSO

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Bottom Section