# For Each Player In Player Group Deprecated

Grammar — For each player var|Player in group do (Actions)
FlagsSubFunctions | Action

Executes a For Loop using an integer value. This will run the action set included under the For Each Player In Player Group action for every player in the specified player group. For example: If you put a “Set Player Color” action that changed the color for Player , under a For Each Player In Player Group action with the Player Group parameter set to All Players, it would change the color for all players.

# Arguments

  • anyvariable — Player Variable
  • playergroup — Player Group

Returns — void

#AUTOVAR(g, playergroup) = #PARAM(group);
#AUTOVAR(p) = 1;
for ( ; #AUTOVAR(p) <= PlayerGroupCount(#AUTOVAR(g)) ; #AUTOVAR(p) += BoolToInt(#PARAM(var) == PlayerGroupPlayer(#AUTOVAR(g), #AUTOVAR(p))) ) {
    #PARAM(var) = PlayerGroupPlayer(#AUTOVAR(g), #AUTOVAR(p));
    #SUBFUNCS(actions)
}

Category: Player Group / Loops

# Examples

— None found —