SpawnEntityInInventory queries future parent about free inventory location of the future item
503 {
504 if (target.IsPlayer())
505 {
507 }
509 {
510 InventoryLocation il = new InventoryLocation;
511 if (target.GetInventory() && target.GetInventory().FindFirstFreeLocationForNewEntity(className,
FindInventoryLocationType.ANY, il))
512 {
514 if ( eai && eai.IsInherited(
ItemBase) )
515 {
516 if ( health < 0 )
517 {
518 health = eai.GetMaxHealth();
519 }
522 if ( special )
523 {
524 auto debugParams = DebugSpawnParams.WithPlayer(null);
525 eai.OnDebugSpawnEx(debugParams);
526 }
527 }
528 return eai;
529 }
530 }
531 else
532 {
535 }
536 return null;
537 }
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
void SetupSpawnedItem(ItemBase item, float health, float quantity)
Param7< EntityAI, string, float, float, bool, string, FindInventoryLocationType > DevSpawnItemParams
proto native DayZPlayer GetPlayer()
EntityAI SpawnEntityInPlayerInventory(PlayerBase player, string item_name, float health, float quantity, bool special=false, string presetName="", FindInventoryLocationType locationType=FindInventoryLocationType.ANY)
proto native CGame GetGame()