canAdd: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (format)
Line 20: Line 20:




|x1= <code>if (player canAdd "FirstAidKit") then {
|x1= <code>[[if]] ([[player]] [[canAdd]] "FirstAidKit") [[then]] {
   player addItem "FirstAidKit";
   [[player]] [[addItem]] "FirstAidKit";
} else {
} [[else]] {
   hint "Not enough space";
   [[hint]] "Not enough space";
};
};
</code>|= EXAMPLE1  
</code>|= EXAMPLE1  

Revision as of 02:31, 4 September 2014

Hover & click on the images for description

Description

Description:
Check if given object can be stored in inventory of given unit.
Groups:
Uncategorised

Syntax

Syntax:
unit canAdd item
Parameters:
unit: Object
item: String - Config class
Return Value:
Boolean

Examples

Example 1:
if (player canAdd "FirstAidKit") then { player addItem "FirstAidKit"; } else { hint "Not enough space"; };

Additional Information

See also:
See also needed

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

Notes

Bottom Section