addBackpack: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{uc:{{PAGENAME}}}}" to "")
m (Text replacement - "[[Arma 3 " to "[[Arma 3: ")
 
(58 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2oa |Game name=
|game1= arma2oa
|version1= 1.50


|arg= local|Arguments=
|game2= tkoh
|version2= 1.00


|eff= global|Effects=
|game3= arma3
|version3= 0.50


|1.51|Game version=
|arg= local


|gr1 = Containers |GROUP1=
|eff= global


|gr1= Containers


____________________________________________________________________________________________
|descr= Adds a backpack for a unit. If a unit already has a backpack, the old backpack will be placed on the ground under the unit. Items defined in the backpack's config will be added as well.
 
{{Feature | Informative |
| Adds a backpack for a unit. If a unit already has a backpack, the old backpack will be placed on the ground under the unit.
{{Informative |
Classname list of available backpacks:
Classname list of available backpacks:
* [[ArmA 2 OA: Backpacks|Arma 2 OA backpacks]]
* [[Arma 2 OA: Backpacks|Arma 2 OA backpacks]]
* [[Arma 3 CfgVehicles EMPTY|Arma 3 backpacks]] - objects starting with "B_", starts with "''B_AssaultPack_khk''"
* [[Arma 3: CfgVehicles EMPTY|Arma 3 backpacks]] - objects starting with "B_", starts with "''B_AssaultPack_khk''"
}} |DESCRIPTION=
}}
____________________________________________________________________________________________


| unit [[addBackpack]] backpackClassName |SYNTAX=
|s1= unit [[addBackpack]] backpackClassName


|p1= unit: [[Object]] |PARAMETER1=
|p1= unit: [[Object]]
|p2= packClassName: [[String]] |PARAMETER2=
|p2= backpackClassName: [[String]]


| [[Nothing]] |RETURNVALUE=
|r1= [[Nothing]]
____________________________________________________________________________________________
 
|x1= <code>[[this]] [[addBackpack]] "TK_RPG_Backpack_EP1";</code> |EXAMPLE1=


|x2= <code>_mySoldierDude [[addBackpack]] "US_Patrol_Pack_EP1";</code> |EXAMPLE2=
|x1= <sqf>this addBackpack "TK_RPG_Backpack_EP1";</sqf>
____________________________________________________________________________________________


| [[addBackpackGlobal]], [[backpackContainer]], [[firstBackpack]], [[unitBackpack]], [[backpack]], [[backpackCargo]], [[getBackpackCargo]], [[backpackItems]], [[addBackpackCargo]], [[addBackpackCargoGlobal]], [[removeBackpack]], [[clearBackpackCargo]], [[clearBackpackCargoGlobal]], [[clearAllItemsFromBackpack]], [[loadBackpack]], [[backpackSpaceFor]], [[canAddItemToBackpack]], [[addItemToBackpack]], [[removeItemFromBackpack]], [[everyBackpack]]|SEEALSO=
|x2= <sqf>_mySoldierDude addBackpack "US_Patrol_Pack_EP1";</sqf>
}}


<h3 style="display:none">Notes</h3>
|x3= <sqf>_mySoldierDude addBackpack "B_AssaultPack_mcamo_Ammo";// Adds backpack prefilled with items defined in its config</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[addBackpackGlobal]] [[backpackContainer]] [[firstBackpack]] [[unitBackpack]] [[backpack]] [[backpackCargo]] [[getBackpackCargo]] [[backpackItems]] [[addBackpackCargo]] [[addBackpackCargoGlobal]] [[removeBackpack]] [[clearBackpackCargo]] [[clearBackpackCargoGlobal]] [[clearAllItemsFromBackpack]] [[loadBackpack]] [[backpackSpaceFor]] [[canAddItemToBackpack]] [[addItemToBackpack]] [[removeItemFromBackpack]] [[everyBackpack]]
 
}}
[[Category:Arma 2: Operation Arrowhead: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 10:38, 6 May 2024

Hover & click on the images for description

Description

Description:
Adds a backpack for a unit. If a unit already has a backpack, the old backpack will be placed on the ground under the unit. Items defined in the backpack's config will be added as well.
Classname list of available backpacks:
Groups:
Containers

Syntax

Syntax:
unit addBackpack backpackClassName
Parameters:
unit: Object
backpackClassName: String
Return Value:
Nothing

Examples

Example 1:
this addBackpack "TK_RPG_Backpack_EP1";
Example 2:
_mySoldierDude addBackpack "US_Patrol_Pack_EP1";
Example 3:
_mySoldierDude addBackpack "B_AssaultPack_mcamo_Ammo";// Adds backpack prefilled with items defined in its config

Additional Information

See also:
addBackpackGlobal backpackContainer firstBackpack unitBackpack backpack backpackCargo getBackpackCargo backpackItems addBackpackCargo addBackpackCargoGlobal removeBackpack clearBackpackCargo clearBackpackCargoGlobal clearAllItemsFromBackpack loadBackpack backpackSpaceFor canAddItemToBackpack addItemToBackpack removeItemFromBackpack everyBackpack

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