addBackpackGlobal: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("serv...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma3 | | arma3 | ||
|arg= global|arguments= | |arg= global|arguments= | ||
|eff= global|effect= | |eff= global|effect= | ||
|1.32 | |1.32 | ||
|gr1= Unit Inventory | |gr1= Unit Inventory | ||
| Adds a backpack to a unit (even non-local).<br><br> | | Adds a backpack to a unit (even non-local).<br><br> | ||
{{Warning | Beware, the backpack added with this command will be created on the PC [[local]] to the unit you are adding it to, even if executed on the server. Because of this, if non-local unit is the target and one tries to immediately access added backpack, the backpack returned will be [[objNull | Null]]. When adding backpack dynamically to a remote unit, wait until backpack is added (See Example 2)}} | {{Warning | Beware, the backpack added with this command will be created on the PC [[local]] to the unit you are adding it to, even if executed on the server. Because of this, if non-local unit is the target and one tries to immediately access added backpack, the backpack returned will be [[objNull | Null]]. When adding backpack dynamically to a remote unit, wait until backpack is added (See Example 2)}} | ||
| unit '''addBackpackGlobal''' backpack | | unit '''addBackpackGlobal''' backpack | ||
|p1= unit: [[Object]] - soldier | |p1= unit: [[Object]] - soldier | ||
|p2= backpack: [[String]] - backpack class name | |p2= backpack: [[String]] - backpack class name | ||
| [[Nothing]] | | [[Nothing]] | ||
|x1= <code>[[player]] [[addBackpackGlobal]] "B_AssaultPack_khk";</code> | |x1= <code>[[player]] [[addBackpackGlobal]] "B_AssaultPack_khk";</code> | ||
|x2= <code>_unit [[spawn]] | |x2= <code>_unit [[spawn]] | ||
Line 30: | Line 30: | ||
[[waitUntil]] { ![[isNull]] [[backpackContainer]] [[_this]] }; | [[waitUntil]] { ![[isNull]] [[backpackContainer]] [[_this]] }; | ||
[[backpackContainer]] [[_this]] [[addMagazineCargoGlobal]] ["30Rnd_556x45_Stanag",5]; | [[backpackContainer]] [[_this]] [[addMagazineCargoGlobal]] ["30Rnd_556x45_Stanag",5]; | ||
};</code> | };</code> | ||
| [[addBackpack]], [[backpackContainer]], [[firstBackpack]], [[unitBackpack]], [[backpack]], [[backpackCargo]], [[getBackpackCargo]], [[backpackItems]], [[addBackpackCargo]], [[addBackpackCargoGlobal]], [[removeBackpack]], [[clearBackpackCargo]], [[clearBackpackCargoGlobal]], [[clearAllItemsFromBackpack]], [[loadBackpack]], [[backpackSpaceFor]], [[canAddItemToBackpack]], [[addItemToBackpack]], [[removeItemFromBackpack]], [[everyBackpack]] | | [[addBackpack]], [[backpackContainer]], [[firstBackpack]], [[unitBackpack]], [[backpack]], [[backpackCargo]], [[getBackpackCargo]], [[backpackItems]], [[addBackpackCargo]], [[addBackpackCargoGlobal]], [[removeBackpack]], [[clearBackpackCargo]], [[clearBackpackCargoGlobal]], [[clearAllItemsFromBackpack]], [[loadBackpack]], [[backpackSpaceFor]], [[canAddItemToBackpack]], [[addItemToBackpack]], [[removeItemFromBackpack]], [[everyBackpack]] | ||
}} | }} |
Revision as of 00:03, 18 January 2021
Description
- Description:
- Adds a backpack to a unit (even non-local).
- Groups:
- Unit Inventory
Syntax
- Syntax:
- unit addBackpackGlobal backpack
- Parameters:
- unit: Object - soldier
- backpack: String - backpack class name
- Return Value:
- Nothing
Examples
- Example 1:
player addBackpackGlobal "B_AssaultPack_khk";
- Example 2:
_unit spawn { if (!isNull backpackContainer _this) then { removeBackpackGlobal _this; waitUntil { isNull backpackContainer _this }; }; _this addBackpackGlobal "B_AssaultPack_khk"; waitUntil { !isNull backpackContainer _this }; backpackContainer _this addMagazineCargoGlobal ["30Rnd_556x45_Stanag",5]; };
Additional Information
- See also:
- addBackpackbackpackContainerfirstBackpackunitBackpackbackpackbackpackCargogetBackpackCargobackpackItemsaddBackpackCargoaddBackpackCargoGlobalremoveBackpackclearBackpackCargoclearBackpackCargoGlobalclearAllItemsFromBackpackloadBackpackbackpackSpaceForcanAddItemToBackpackaddItemToBackpackremoveItemFromBackpackeveryBackpack
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note