DayZ 1.28
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:3868

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

6295 {
6296 InventoryLocation inv_loc = new InventoryLocation;
6297 if (GetInventory().FindFirstFreeLocationForNewEntity(item_name, FindInventoryLocationType.ANY, inv_loc))
6298 {
6299 return SpawnItemOnLocation(item_name, inv_loc, full_quantity);
6300 }
6301 return NULL;
6302 }
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
Определения ItemBase.c:4855

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