Auto-translated
What a mess with the messages, though!
Firstly, MessageBoxForPlayers (and QuestionBoxForPlayers) requires a player filter as the first argument, not the player number.
Secondly, if the player is an AI, the message is displayed to the human player.
This may not be noticeable when there are only two players (the filters with the player numbers match), but when there are more, the messages are shown to the wrong players.
Take a look at how Avrana did it.