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

◆ CreateWeaponWithAmmo()

static Weapon_Base Weapon::CreateWeaponWithAmmo ( string weaponType,
string magazineType = "",
int flags = WeaponWithAmmoFlags.CHAMBER )
inlinestaticprotected

Create weapon with ammo.

Аргументы
[in]weaponTypestring The weapon to create
[in]magazineTypestring The magazine to attach or ammo to load, passing in empty string will select random
[in]flagsint Setup flags, please read WeaponWithAmmoFlags
Возвращает
The created weapon

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

727 {
728 Weapon_Base wpn = Weapon_Base.Cast(GetGame().CreateObjectEx( weaponType, vector.Zero, ECE_PLACE_ON_SURFACE ));
729
730 if ( !wpn )
731 {
732 ErrorEx(string.Format("%1 does not exist or is not a weapon.", weaponType));
733 return null;
734 }
735
736 wpn.SpawnAmmo(magazineType, flags);
737 return wpn;
738 }
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
void Weapon_Base()
Определения Weapon_Base.c:78
proto native CGame GetGame()
enum ShapeType ErrorEx

Перекрестные ссылки ECE_PLACE_ON_SURFACE, ErrorEx, GetGame(), Weapon_Base() и vector::Zero.