# Save Data Table Value (Player Group)

Grammar — Save value as name in the scope|Global/Local data table
FlagsNative | Action

Saves a player group value into a data table. Data tables allow you to store and recall values using a string identifier. If you save a data table value using a string identifier that already exists, you will overwrite the old value, even if it is a different data type than the value you are saving.

# Arguments

  • bool [ preset::DataScope ] — Scope
  • string — Name
  • playergroup — Value

Returns — void

native void DataTableSetPlayerGroup(
	bool global,
	string name,
	playergroup val,
);

Category: Data Table / Save Value

# Examples

# mods/heroesdata.stormmod

GameLib.galaxy

// L3324
DataTableSetPlayerGroup(false, TriggerEventParamName(libGame_gv_eventID_CapturePointChangesOwner_C, libGame_gv_eventParam_CapturePointChangesOwner_CapturingPlayers_C), lp_capturingPlayers)
// L4414
DataTableSetPlayerGroup(false, TriggerEventParamName(libGame_gv_eventID_MercCampCaptured_C, libGame_gv_eventParam_MercCampCaptured_CapturingPlayers_C), lp_capturingPlayers)
// L4788
DataTableSetPlayerGroup(false, TriggerEventParamName(libGame_gv_eventID_MapObeliskOwnershipChange_C, libGame_gv_eventParam_MapObeliskOwnershipChange_CapturingPlayers_C), lp_capturingPlayers)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L2790
DataTableSetPlayerGroup(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_ExcludedPlayers_Name(lv_unitTypeIndex), lv_alreadyExcludedPlayers)