DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CreateInInventory()

EntityAI ManBase::CreateInInventory ( string item_name,
string cargo_type = "",
bool full_quantity = false )
inlineprotected

/brief Creates ItemBase in players inventory. If player dont have enough slots for new item, item will be created on the ground under player.

Аргументы
item_namestring Class name of ItemBase in configs
Возвращает
ItemBase Created item
ItemBase item = g_Game.GetPlayer().CreateInInventory("Consumable_GardenLime", "cargo_weapon");
DayZGame g_Game
Определения DayZGame.c:4074

См. определение в файле PlayerBase.c строка 6846

6847 {
6848 InventoryLocation inv_loc = new InventoryLocation;
6849 if (GetInventory().FindFirstFreeLocationForNewEntity(item_name, FindInventoryLocationType.ANY, inv_loc))
6850 {
6851 return SpawnItemOnLocation(item_name, inv_loc, full_quantity);
6852 }
6853 return NULL;
6854 }
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
EntityAI SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
Определения ItemBase.c:4952

Перекрестные ссылки SpawnItemOnLocation().