DayZ 1.29
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:3942

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

6526 {
6527 InventoryLocation inv_loc = new InventoryLocation;
6528 if (GetInventory().FindFirstFreeLocationForNewEntity(item_name, FindInventoryLocationType.ANY, inv_loc))
6529 {
6530 return SpawnItemOnLocation(item_name, inv_loc, full_quantity);
6531 }
6532 return NULL;
6533 }
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
Определения ItemBase.c:4911

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