I can't figure out why I keep getting this error. Error: Code: 2017-01-13 [12:55:38] [Server thread/CRITICAL]: Unhandled exception executing command 'fpp leave' in factionspp: Call to a member function set() on array 2017-01-13 [12:55:38] [Server thread/CRITICAL]: Error: "Call to a member function set() on array" (EXCEPTION) in "/phar_Factionspp_D0Gx4JdlJySCPrE.phar/src/HittmanA/factionspp/MainClass" at line 111 Code: https://github.com/dihydrogen-monoxide/Factions-pp
You should have provide snippets since code can be changed when view also i think this should be solved here? https://github.com/dihydrogen-monoxide/Factions-pp/commit/86d3b606a1a376a26de2636ef35e72c769e61a39
This doesn't really work: PHP: $this->playerInfo->$displayName->set("faction",""); What you could try: PHP: $this->playerInfo->setNested($displayName, ["faction" => ""]); I'm not sure how I can explain it to you so you understand it correctly, but I hope you understand when I say that if you use -> you most likely try to access a property/function of a class (Correct me if I'm wrong). But I suppose you tried to just save data under the display name of the player, which didn't work out well. What I did now: The data inside the array (["faction" => ""]) is now saved under $displayName inside the config. I hope that's what you wanted. (First parameter of setNested() is the key, and the second one is the value of the key)
This is what the player data storage object looks like: Code: { "Player1" : { "name" : "Player1", "faction" : "Me", "role" : "Leader" }, "Player2" : { "name" : "Player2", "faction" : "You", "role" : "Leader" } } What I need to do is set the faction and role to nothing ("").