How can you store update the player list if a player joins the game?

I just check if the eliminator is the same as the eliminated agent. It works in my gun game

 OnPlayerEliminated(Result : elimination_result) : void =
        Eliminator := Result.EliminatingCharacter
        Eliminated := Result.EliminatedCharacter

        if (EliminatingFortCharacter := Eliminator?, EliminatingAgent := EliminatingFortCharacter.GetAgent[]):
            if (EliminatedFortCharacter := Eliminated, EliminatedAgent := EliminatedFortCharacter.GetAgent[]):
                    if(EliminatedAgent<>EliminatingAgent):
                        Print("We need to promote player")
                        PromotePlayer(EliminatingAgent)
                        HealPlayer(EliminatingFortCharacter)
                        Print("The Player has been Promoted")
                    else:
                        Print("Error promoting the player: Eliminator and Elimitated are the SAME PLAYER")

@b3rtl3d

1 Like