DayZ Scripts
PC Stable Documentation
 
Loading...
Searching...
No Matches
P:/scripts/3_Game/Systems/Inventory/InventorySlots.c

int slot = InventorySlots.GetSlotIdFromString("FireWood"); if (slot != InventorySlots.INVALID)

@NOTE the example looks in the DZ/data/config.cpp and searches for class entry Slot_##slot_name class Slot_Firewood { whatever };

i.e. it does NOT look at name= or displayName= attributes of the entry!

{
const int COUNT;
const int INVALID;
#ifdef DIAG_DEVELOPER
private void InventorySlots() {}
private void ~InventorySlots() {}
#else
void InventorySlots() {}
void ~InventorySlots() {}
#endif
static proto native int GetSlotIdFromString(string slot_name);
static proto native owned string GetSlotName(int id);
static proto native owned string GetSlotDisplayName(int id);
static proto native bool IsSlotIdValid(int slotId);
static proto native int GetStackMaxForSlotId(int slot_Id);
static proto native bool GetShowForSlotId(int slot_Id);
static proto native bool GetAutoAttachForSlotId(int slot_Id);
static proto bool GetBoneNameForSlotId(int slot_Id, out string bone_name);
static proto bool GetSelectionForSlotId(int slot_Id, out string selection);
//static proto native int GetBoneIndexForSlotId (int slot_Id);
};
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
void InventorySlots()
Definition InventorySlots.c:24
static proto bool GetBoneNameForSlotId(int slot_Id, out string bone_name)
static proto native bool IsSlotIdValid(int slotId)
verifies existence of the slot id
static proto native int GetStackMaxForSlotId(int slot_Id)
const int COUNT
Amount of pre-populated slots (32)
Definition InventorySlots.c:15
static proto native owned string GetSlotName(int id)
converts slot_id to string
void ~InventorySlots()
Definition InventorySlots.c:25
static proto bool GetSelectionForSlotId(int slot_Id, out string selection)
static proto native owned string GetSlotDisplayName(int id)
converts slot_id to string
static proto native bool GetShowForSlotId(int slot_Id)
static proto native bool GetAutoAttachForSlotId(int slot_Id)
const int INVALID
Invalid slot (-1)
Definition InventorySlots.c:17