How would you log the players that join a specific world down into a list of some sort as variables? Say player1 joined. Then player2 joined. How would you be able to log them down as variables into a list or something? Also, how do you assign another status on this variable? Say I define $dog = "dog". It is saved as a variable. Now I want to add a attribute to this variable. Let's define the dog's color as brown. How would you be able to list and save attribute like that? Thank you!
$this->attributes = []; $this->attributes["dog"]["eyes"] = array("brown","blue"); I think it's what you want.
For the first question, you won't want to do that because it will overload the memory. But if it is just for a short period of time: 1. Put this in the class declaration in your class: PHP: class blah...{ public $log=[]; Blah...} 2. For $main as your main class's instance ($this if you are in the main class's context), $main->log[]=$player->getName();