Fandom

武装突袭 Wiki

BIS_fnc_addWeapon

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Introduced with Arma 3 version 1.00
  

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
1.00

Description

Description:
Adds a weapon to the specified unit, with magazine classnames taken from the weapon's config (in CfgWeapons). This function does not remove magazines nor weapons prior to adding the new weapon, so that still has to be done manually.

Syntax

Syntax:
[unit, "weaponClassName", 1, 0] call BIS_fnc_addWeapon;
Parameters:
Object - Unit to add weapon to.

String - Weapon Classname (found in CfgWeapons).

Number - Amount of magazines.

Number - Index of magazine name that should be used, OR:
String - Magazine name to be used.
Optional parameter, default 0. Found in magazines={} array.
Return Value:
String - Primary(!) muzzle name of weapon.

Examples

Example 1:
newGun = [player, "arifle_SDAR_F", 6] call BIS_fnc_addWeapon; // Adds 6 dual-purpose magazines and the underwater gun to the player.

Example 2:
newGun = [bluforUnit, "arifle_Mk20_F", 2, 1] call BIS_fnc_addWeapon; // Adds 2 30 Rnd Stanag Tracer (Red) magazines to bluforUnit, with an Mk20_F.

Example 3:
newGun = [player, "arifle_Mk20_F", 2, "30Rnd_556x45_Stanag_Tracer_red"] call BIS_fnc_addWeapon; // Alternative syntax of second example, with magazine name written out.

Additional Information

Execution:
call
Multiplayer:
-
See also:

addWeaponselectWeapon

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section

Posted on September 29, 2014 - 18:13 (UTC)
Tryteyker-
This function only returns the primary muzzle name of a gun. For more info on how to select guns' secondary muzzle names (like an underhand grenade launcher), view the notes on selectWeapon.

更多维基

随机维基