# 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.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:3324

    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_CapturePointChangesOwner_C, libGame_gv_eventParam_CapturePointChangesOwner_CapturePointIndex_C), lp_capturePointIndex);
    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_CapturePointChangesOwner_C, libGame_gv_eventParam_CapturePointChangesOwner_Owner_C), lp_owner);
    DataTableSetPlayerGroup(false, TriggerEventParamName(libGame_gv_eventID_CapturePointChangesOwner_C, libGame_gv_eventParam_CapturePointChangesOwner_CapturingPlayers_C), lp_capturingPlayers);
    DataTableSetBool(false, TriggerEventParamName(libGame_gv_eventID_CapturePointChangesOwner_C, libGame_gv_eventParam_CapturePointChangesOwner_HasMercLordTalent_C), lp_hasMercLordTalent);
    TriggerSendEvent(libGame_gv_eventID_CapturePointChangesOwner_C);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:4414

    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_MercCampCaptured_C, libGame_gv_eventParam_MercCampCaptured_Index_C), lp_camp);
    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_MercCampCaptured_C, libGame_gv_eventParam_MercCampCaptured_Owner_C), lp_owner);
    DataTableSetPlayerGroup(false, TriggerEventParamName(libGame_gv_eventID_MercCampCaptured_C, libGame_gv_eventParam_MercCampCaptured_CapturingPlayers_C), lp_capturingPlayers);
    TriggerSendEvent(libGame_gv_eventID_MercCampCaptured_C);
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:4788

    DataTableSetInt(false, TriggerEventParamName(libGame_gv_eventID_MapObeliskOwnershipChange_C, libGame_gv_eventParam_MapObeliskOwnershipChange_Team_C), lp_team);
    DataTableSetUnit(true, TriggerEventParamName(libGame_gv_eventID_MapObeliskOwnershipChange_C, libGame_gv_eventParam_MapObeliskOwnershipChange_Obelisk_C), lp_obelisk);
    DataTableSetPlayerGroup(false, TriggerEventParamName(libGame_gv_eventID_MapObeliskOwnershipChange_C, libGame_gv_eventParam_MapObeliskOwnershipChange_CapturingPlayers_C), lp_capturingPlayers);
    TriggerSendEvent(libGame_gv_eventID_MapObeliskOwnershipChange_C);
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:2790

    lv_alreadyExcludedPlayers = libCOMI_gf_CM_CoopAI_AttackForce_GetExcludedPlayers(lv_unitTypeIndex);
    libNtve_gf_AddPlayerGroupToPlayerGroup(lp_excludePlayers, lv_alreadyExcludedPlayers);
    DataTableSetPlayerGroup(libCOMI_gv_cMC_CoopAI_AttackForce_DataTableScope, libCOMI_gf_CM_CoopAI_AttackForce_ExcludedPlayers_Name(lv_unitTypeIndex), lv_alreadyExcludedPlayers);
}