Jump to content

SetItem: Difference between revisions

From CMM Wiki
SetItem – created via PowerShell script (2025-11-11T21:11:52Z)
Tag: Recreated
 
m SetItem – created via PowerShell script (2026-02-11T01:15:41Z)
 
Line 1: Line 1:
{{Template:FunctionInfo|fName=          SetItem|fDescription=  This function will set an item type of a specified quantity to an Airbase Warehouse|parentFile=    cmm.AirBaseFunctions.lua|syntax=        CMM.SetItem(<Airbase Object Table>,<string>,<number>)|return=        nil|returnDesc=    Returns nil|example=        CMM.SetItem(Airbase.getByName("Sochi-Adler"):getWarehouse(),tostring("weapons.missiles.AGM_114K"), 5)|exampleDesc=    |related=        |note=          |envType= CMM|par1=        table WareHouse|reqType1=    table|reqName1=    WareHouse|desc1=      Warehouse Object|par2=        string ItemType|reqType2=    string|reqName2=    ItemType|desc2=      ItemType Name (can be aircraft or weapon or equipment name)|par3=        number Value|reqType3=    number|reqName3=    Value|desc3=      Amount of item to set}}
{{Template:FunctionInfo|fName=          SetItem|fDescription=  This function will set an item type of a specified quantity to the supplied Warehouse|parentFile=    cmm.AirBaseFunctions.lua|syntax=        CMM.SetItem(<Warehouse Object Table>,<string>,<number>)|return=        boolean|returnDesc=    Returns nil|example=        CMM.SetItem(Airbase.getByName("Sochi-Adler"),tostring("weapons.missiles.AGM_114K"), 5)|exampleDesc=    |related=        |note=          |envType= CMM|par1=        table WH|reqType1=    table|reqName1=    WH|desc1=      Warehouse Object|par2=        string ItemType|reqType2=    string|reqName2=    ItemType|desc2=      ItemType Name|par3=        number Value|reqType3=    number|reqName3=    Value|desc3=      Amount of item to add}}

Latest revision as of 14:15, 10 February 2026

Return to CMM Command Reference
Environment: Mission Scripting
Function: SetItem
Function Description: This function will set an item type of a specified quantity to the supplied Warehouse
File Location: cmm.AirBaseFunctions.lua
Syntax: CMM.SetItem( table WH , string ItemType , number Value )
Return Value: boolean
Parameters: Name Description
WHWarehouse Object
ItemTypeItemType Name
ValueAmount of item to add
Example: CMM.SetItem(Airbase.getByName("Sochi-Adler"),tostring("weapons.missiles.AGM_114K"), 5)
Example Description:
Related Functions:
Notes: