BIS fnc limitItems: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision imported: BIS Functions update 2/7)
m (Some wiki formatting)
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.00


| arma3 |= Game name
|gr1= Inventory


|1.00|= Game version
|descr= Keeps or removes unit's items (including NVGs and binocular/designator) based on probability user sets.
____________________________________________________________________________________________


| <pre>/*
|s1= [unit, chanceNVG, chanceBino, chanceGPS, chanceMap, chanceRadio, chanceCompass, chanceWatch] call [[BIS_fnc_limitItems]]
Author: Vaclav "Watty Watts" Oliva


Description:
|p1= unit: [[Object]]
Keeps or removes unit's items (including NVGs and binocular/designator) based on probability user sets.
- use 0-100 to randomize the chance of keeping the current attachment
- use 100 to always keep the attachment
- use 0 to always remove the attachment


Parameters:
|p2= chanceNVG: [[Number]] - (Optional, default 50) chance to keep NVGs in % (range 0..100)
Select 0 - OBJECT: Target unit
* 0 = NVGs are always removed
Select 1 - NUMBER: Chance to keep the NVGs. Default is 50.
* 100 = NVGs are always kept
Select 2 - NUMBER: Chance to keep the binocular. Default is 50.
Select 3 - NUMBER: Chance to keep the GPS. Default is 50.
Select 4 - NUMBER: Chance to keep the map. Default is 50.
Select 5 - NUMBER: Chance to keep the radio. Default is 50.
Select 6 - NUMBER: Chance to keep the compass. Default is 50.
Select 7 - NUMBER: Chance to keep the watch. Default is 50.


Returns:
|p3= chanceBino: [[Number]] - (Optional, default 50) chance to keep binoculars in %
Boolean


Examples:
|p4= chanceGPS: [[Number]] - (Optional, default 50) chance to keep GPS in %
_limit = [player] call BIS_fnc_limitItems;
_limit = [player,0,15,30,45,60,75,90] call BIS_fnc_limitItems;
*/


// Params
|p5= chanceMap: [[Number]] - (Optional, default 50) chance to keep Map in %
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_limitItems]]; --> |= Syntax
|p6= chanceRadio: [[Number]] - (Optional, default 50) chance to keep radio in %
|p1= |= Parameter 1


| |= Return value
|p7= chanceCompass: [[Number]] - (Optional, default 50) chance to keep compass in %
____________________________________________________________________________________________


|x1= <code></code> |=
|p8= chanceWatch: [[Number]] - (Optional, default 50) chance to keep watch in %
____________________________________________________________________________________________


| |= See also
|r1= [[Boolean]] - always [[true]]


}}
|x1= <sqf>player call BIS_fnc_limitItems;</sqf>


<h3 style="display:none">Notes</h3>
|x2= <sqf>[player, 0, 15, 30, 45, 60, 75, 90] call BIS_fnc_limitItems;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|seealso= [[BIS_fnc_limitWeaponItems]] [[BIS_fnc_limitAmmunition]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Inventory|{{uc:limitItems}}]]
[[Category:Functions|{{uc:limitItems}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:limitItems}}]]

Latest revision as of 11:05, 8 November 2023

Hover & click on the images for description

Description

Description:
Keeps or removes unit's items (including NVGs and binocular/designator) based on probability user sets.
Execution:
call
Groups:
Inventory

Syntax

Syntax:
[unit, chanceNVG, chanceBino, chanceGPS, chanceMap, chanceRadio, chanceCompass, chanceWatch] call BIS_fnc_limitItems
Parameters:
unit: Object
chanceNVG: Number - (Optional, default 50) chance to keep NVGs in % (range 0..100)
  • 0 = NVGs are always removed
  • 100 = NVGs are always kept
chanceBino: Number - (Optional, default 50) chance to keep binoculars in %
chanceGPS: Number - (Optional, default 50) chance to keep GPS in %
chanceMap: Number - (Optional, default 50) chance to keep Map in %
chanceRadio: Number - (Optional, default 50) chance to keep radio in %
chanceCompass: Number - (Optional, default 50) chance to keep compass in %
chanceWatch: Number - (Optional, default 50) chance to keep watch in %
Return Value:
Boolean - always true

Examples

Example 1:
player call BIS_fnc_limitItems;
Example 2:
[player, 0, 15, 30, 45, 60, 75, 90] call BIS_fnc_limitItems;

Additional Information

See also:
BIS_fnc_limitWeaponItems BIS_fnc_limitAmmunition

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