BIS fnc keyHold: Difference between revisions
Jump to navigation
Jump to search
(As this function does return bool value when called, added info to r1 + x2 with call inside spawn) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 8: | Line 8: | ||
|eff= local | |eff= local | ||
|descr= Allows for hold button interactions. Hold action is started by pressing | |descr= Allows for hold button interactions. Hold action is started by pressing {{Controls|Space}}. | ||
|s1= [description, duration, condition, arguments, loaded] spawn [[BIS_fnc_keyHold]] | |s1= [description, duration, condition, arguments, loaded] spawn [[BIS_fnc_keyHold]] | ||
|p1= description: [[String]] - | |p1= description: [[String]] - description of the performed action, displayed inside the progress bar. | ||
|p2= duration: [[Number]] - (Optional, default 2) | |p2= duration: [[Number]] - (Optional, default 2) action duration | ||
|p3= condition: [[Code]] or [[String]] - (Optional, default { | |p3= condition: [[Code]] or [[String]] - (Optional, default <sqf inline>{ true }</sqf>) condition that must be met for the action to display | ||
|p4= arguments: [[Array]] - (Optional, default []) | |p4= arguments: [[Array]] - (Optional, default <sqf inline>[]</sqf>) arguments passed to the condition | ||
|p5= loaded: [[Boolean]] - (Optional, default [[false]]) | |p5= loaded: [[Boolean]] - (Optional, default [[false]]) defines if function is already loaded. This is handled by the function | ||
|r1= [[ | |r1= | ||
* [[spawn]]: [[Script Handle]] | |||
* [[call]]: [[true]] if action was successful or [[false]] if it was interrupted. | |||
|x1= <sqf>["Hold that key!",2,{alive player}] spawn BIS_fnc_keyHold;</sqf> | |x1= <sqf>["Hold that key!", 2, { alive player }] spawn BIS_fnc_keyHold;</sqf> | ||
|x2= Function can be called in [[Scheduler#Scheduled_Environment|scheduled environment]] to return values and be used for further code execution. | |x2= Function can be called in [[Scheduler#Scheduled_Environment|scheduled environment]] to return values and be used for further code execution. | ||
private _success = ["Hold that key!", 2, {alive player}] call BIS_fnc_keyHold; | <sqf> | ||
if (_success) then {hint "Function executed"} else {hint "Function interrupted"}; | 0 spawn { | ||
}</sqf> | private _success = ["Hold that key!", 2, { alive player }] call BIS_fnc_keyHold; | ||
if (_success) then { hint "Function executed" } else { hint "Function interrupted" }; | |||
}; | |||
</sqf> | |||
|exec= spawn | |exec= spawn |
Latest revision as of 13:59, 24 May 2023
Description
- Description:
- Allows for hold button interactions. Hold action is started by pressing Space.
- Execution:
- spawn
- Groups:
- Interaction
Syntax
- Syntax:
- [description, duration, condition, arguments, loaded] spawn BIS_fnc_keyHold
- Parameters:
- description: String - description of the performed action, displayed inside the progress bar.
- duration: Number - (Optional, default 2) action duration
- condition: Code or String - (Optional, default { true }) condition that must be met for the action to display
- arguments: Array - (Optional, default []) arguments passed to the condition
- loaded: Boolean - (Optional, default false) defines if function is already loaded. This is handled by the function
- Return Value:
-
- spawn: Script Handle
- call: true if action was successful or false if it was interrupted.
Examples
- Example 1:
- Example 2:
- Function can be called in scheduled environment to return values and be used for further code execution.
Additional Information
- See also:
- BIS_fnc_holdActionAdd BIS_fnc_holdKey
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