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

◆ CreateMagazinePiles()

static array< Magazine > CreateMagazinePiles ( string item_name,
vector ground_position,
float quantity,
float health )
staticprotected

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

554 {
555 array<Magazine> items;
556 float stack_size;
557 Magazine pile;
558
559 items = new array<Magazine>;
560 stack_size = g_Game.ConfigGetInt("cfgMagazines " + item_name + " count");
561
562 int piles_count = Math.Floor(quantity/stack_size);
563 int rest = quantity - (piles_count*stack_size);
564
565 for (int i = 0; i < piles_count; ++i)
566 {
567 pile = Magazine.Cast(GetGame().CreateObjectEx(item_name, ground_position, ECE_PLACE_ON_SURFACE));
568 pile.ServerSetAmmoCount(stack_size);
569 items.Insert(pile);
570 }
571 if (rest > 0)
572 {
573 pile = Magazine.Cast(GetGame().CreateObjectEx(item_name, ground_position, ECE_PLACE_ON_SURFACE));
574 pile.ServerSetAmmoCount(rest);
575 items.Insert(pile);
576 }
577 return items;
578 }
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
DayZGame g_Game
Определения DayZGame.c:3868
Определения EnMath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static proto float Floor(float f)
Returns floor of value.

Перекрестные ссылки ECE_PLACE_ON_SURFACE, Math::Floor(), g_Game и GetGame().