BIS fnc switchLamp: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects? in MP|Multiplayer Effects(...) |
Lou Montana (talk | contribs) m (Text replacement - "(\|[pr][0-9]+ *= *[^-\r\n]+) *- *S([a-z])" to "$1 - s$2") |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=function | ||
| | |game1= arma3 | ||
|version1= 1.64 | |||
|eff= local | |||
|eff= | |||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
| Switch streetlamp on/off | |descr= Switch streetlamp on/off. | ||
| [object, state] call [[BIS_fnc_switchLamp]] | |s1= [object, state] call [[BIS_fnc_switchLamp]] | ||
| [[Nothing]] | |r1= [[Nothing]] | ||
|p1= object: [[Object]] - | |p1= object: [[Object]] - street Lamp | ||
|p2= state: [[Boolean]] - true to turn lamp on, false to turn it off | |p2= state: [[Boolean]] - true to turn lamp on, false to turn it off | ||
|x1= < | |x1= <sqf> | ||
// switches all lamps off in a radius of 200m | |||
{ [_x, | private _lampsIn200m = nearestObjects [player, ["Lamps_base_F", "PowerLines_base_F", "PowerLines_Small_base_F"], 200]; | ||
{ [_x, false] call BIS_fnc_switchLamp; } forEach _lampsIn200m; | |||
</sqf> | |||
|x2= < | |x2= <sqf> | ||
aLamp | // simulates a damaged street light | ||
[[ | aLamp spawn { | ||
params [ | |||
["_lamp", objNull, [objNull]] | |||
]; | |||
while { player distance _lamp < 200 } do | |||
{ | { | ||
[_lamp, | [_lamp, selectRandom [true, false]] call BIS_fnc_switchLamp; | ||
sleep 0.1 + random 0.5; | |||
}; | }; | ||
};</ | }; | ||
</sqf> | |||
| [[switchLight]] | |seealso= [[switchLight]] | ||
}} | }} | ||
Latest revision as of 14:44, 8 November 2023
Description
- Description:
- Switch streetlamp on/off.
- Execution:
- call
- Groups:
- Object Manipulation
Syntax
- Syntax:
- [object, state] call BIS_fnc_switchLamp
- Parameters:
- object: Object - street Lamp
- state: Boolean - true to turn lamp on, false to turn it off
- Return Value:
- Nothing
Examples
- Example 1:
- Example 2:
Additional Information
- See also:
- switchLight
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