BIS fnc switchLamp: Difference between revisions
Jump to navigation
Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki) |
(Created page with "{{Function|= ____________________________________________________________________________________________ |Arma3|= Game |DEV|= Game Version (number surrounded by NO SPACES)...") |
||
Line 1: | Line 1: | ||
{{Function|= | |||
____________________________________________________________________________________________ | |||
|Arma3|= Game | |||
|DEV|= Game Version (number surrounded by NO SPACES) | |||
| | |arg= global |= Multiplayer Arguments | ||
| | |eff= global |= Multiplayer Effects | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | Switch streetlamp on/off |= Description | ||
____________________________________________________________________________________________ | |||
| [_object, _state] [[call]] '''BIS_fnc_switchLamp'''; |= Syntax | |||
| [[Nothing]] |= RETURNVALUE | |||
|p1= [[Object]] - Street Lamp |= Parameter 1 | |||
|p2= [[Bool]] - State: True to turn lamp on, false to turn it off|= Parameter 2 | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| < | |x1= <code> | ||
{ | |||
[_x,[[true]]] call '''BIS_fnc_switchLamp'''; | |||
[[false]]; | |||
} [[count]] [[nearestObjects]] [ [[player]],["Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F"],200] | |||
</code> |= Example 1 | |||
|x1= <code></code> |= | |x1= <code> | ||
{ | |||
[_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 | |||
</code> |= Example 1 | |||
|x2= <code> | |||
[[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 | |||
}; | |||
</code> |= Example 2 | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| |= See | | SEEALSO |= See Also | ||
}} | }} | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<!-- Note Section | <!-- BEGIN Note Section --> | ||
<!-- For example: | |||
<!-- Note Section | <dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd> | ||
<dt class="note">'''[[User:User Name|User Name]]'''</dt> | |||
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet. | |||
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd> | |||
--> | |||
<!-- END Note Section --> | |||
</dl> | </dl> | ||
<h3 style="display:none">Bottom Section</h3> | <h3 style="display:none">Bottom Section</h3> | ||
[[Category: | <!-- Appropriate categories go here --> | ||
[[Category:Arma 3: Functions|{{uc:{{PAGENAME}}}}]] | |||
Revision as of 19:01, 4 August 2016
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