DayZ 1.27
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
Определения InventoryItem.c:731

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

6303 {
6304 InventoryLocation inv_loc = new InventoryLocation;
6305 if (GetInventory().FindFirstFreeLocationForNewEntity(item_name, FindInventoryLocationType.ANY, inv_loc))
6306 {
6307 return SpawnItemOnLocation(item_name, inv_loc, full_quantity);
6308 }
6309 return NULL;
6310 }
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:4783

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