BIS fnc counter: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|+$" to "")
(Page filling)
Line 9: Line 9:
|gr1= Systems
|gr1= Systems


|descr= <pre>/*
|descr= Modify the given counter, create it if does not exist.


Description:
|s1= [varName, add, modulo] call [[BIS_fnc_counter]]
Modify the given counter (create it if doesn't exist)


Parameter(s):
|p1= varName: [[String]] or [[Array]] format [varName, namespace] - default namespace is [[missionNamespace]]
_this select 0:
STRING - variable name of counter
ARRAY in format [variableName,nameSpace], where nameSpace can be object, group or missionNameSpace/uiNameSpace
_this select 1 (Optional): NUMBER - added value
_this select 2 (Optional): NUMBER - modulo value


Returns:
|p2= add: [[Number]] - (Optional, default 0) the value to be added
NUMBER - counter's value
*/</pre>


{{Wiki|placeholder}}
|p3= modulo: [[Number]] - (Optional, default -1) the [[mod]]ulo to use for counter cycle
|s1= <!-- [] call [[BIS_fnc_counter]] -->


|r1=
|r1= [[Number]] the new counter value


|x1=
|x1= <sqf>[player, 1] call BIS_fnc_counter;</sqf>


|seealso= [[BIS_fnc_deleteCounter]]
|seealso= [[BIS_fnc_deleteCounter]]
}}
}}

Revision as of 16:30, 11 April 2024

Hover & click on the images for description

Description

Description:
Modify the given counter, create it if does not exist.
Execution:
call
Groups:
Systems

Syntax

Syntax:
[varName, add, modulo] call BIS_fnc_counter
Parameters:
varName: String or Array format [varName, namespace] - default namespace is missionNamespace
add: Number - (Optional, default 0) the value to be added
modulo: Number - (Optional, default -1) the modulo to use for counter cycle
Return Value:
Number the new counter value

Examples

Example 1:
[player, 1] call BIS_fnc_counter;

Additional Information

See also:
BIS_fnc_deleteCounter

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