Inventory Check

13mknight

Member
Does anyone know a way to check if a players inventory is full?

Have a script that adds an item but obviously i dont want it to say its adding it if the players inventory is full! Haha thanks.
 
Code:
_item = "ItemTent"; //Example
_itemName = getText (configFile >> "CfgMagazines" >> _item >> "displayName");
_result = [player,_item] call BIS_fnc_invAdd;
    if (_result) then {
        cutText [format["You now have a %1!", _itemName], "PLAIN DOWN"];
    }else{
        cutText [format["I cannot give you %1, not enough room in your pockets sir!", _itemName], "PLAIN DOWN"];
    }
 
Code:
_item = "ItemTent"; //Example
_itemName = getText (configFile >> "CfgMagazines" >> _item >> "displayName");
_result = [player,_item] call BIS_fnc_invAdd;
    if (_result) then {
        cutText [format["You now have a %1!", _itemName], "PLAIN DOWN"];
    }else{
        cutText [format["I cannot give you %1, not enough room in your pockets sir!", _itemName], "PLAIN DOWN"];
    }


Where do you apply this code dude?
 
This is used to give a player some inventory with a success or failure message afterwards, the code will go in whatever place you intend to give the player the inventory item.
 
Back
Top