武装突袭 Wiki
注册
Advertisement
Introduced with Operation Flashpoint version 1.27
  Arguments of this scripting command have to be local to the client the command is executed onEffects of this scripting command are broadcasted over the network and happen on every computer in the network

点击图片可看到更多讯息

开始使用于

游戏:
Operation Flashpoint
版本:
1.27

描述

描述:
Selects the given weapon. Note: For weapons that have more than one muzzle, you have to input the muzzlename and not the weaponName.
The only weapons that have muzzleNames seem to be rifles with grenade launchers, handgrenades, smokeshells and satchels.
In all other cases the weaponName must be used. Fortunately, in OFP, in most cases, both names are the same. But check.
In ArmA the weaponNames and muzzleNames are different.
For muzzle names see cfgWeapons.
NOTE: The unit must be local to the PC on which command is executed.

基本句法

句法:
unitName selectWeapon muzzleName
参数:
unitName: Object
muzzleName: String
返回值:
Nothing

范例

范例1:
_soldier1 selectWeapon "LAWLauncher";
范例2:
player selectWeapon "M203Muzzle";

额外资讯

多人游戏:
-
也可以看看:
fireforceWeaponFireprimaryWeaponhandgunWeaponsecondaryWeaponweaponsaction SwitchWeaponaction SwitchMagazine

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Posted on 5 Aug, 2008
Dr_Eyeball
Rather than simply using selectWeapon to select your default weapon after adding them to your player, it is recommended you use a script instead similar to the following, which caters for multiple muzzles:
SelectWeapon.sqf
 // Desc: select default weapon & handle multiple muzzles
 if (count weapons player > 0) then
 {
   private['_type', '_muzzles'];
 
   _type = ((weapons player) select 0);
   // check for multiple muzzles (eg: GL)
   _muzzles = getArray(configFile >> "cfgWeapons" >> _type >> "muzzles");
 
   if (count _muzzles > 1) then
   {
     player selectWeapon (_muzzles select 0);
   }
   else
   {
     player selectWeapon _type;
   };
 };
Posted on 22 Mar, 2010
MaestrO.fr
Can be used with primaryWeapon to select the primary weapon. An example with muzzle care (see Dr_EyeBall note) :
 if ( (primaryWeapon player) != "") then
 {
   private['_type', '_muzzles'];
 
   _type = primaryWeapon player;
   // check for multiple muzzles (eg: GL)
   _muzzles = getArray(configFile >> "cfgWeapons" >> _type >> "muzzles");
 
   if (count _muzzles > 1) then
   {
     player selectWeapon (_muzzles select 0);
   }
   else
   {
     player selectWeapon _type;
   };
 };

Bottom Section

Advertisement