uhhh, i'd like to apologize in advance for the extent of my ignorance now, I've recently begun working on beAreaGuard with the expressed permission of Blue Electric. I've been asked by a user to provide console access to two commands within that plugin. /areaworld and /areabuilder Code: case "areabuilder": if ( $user instanceof Player ){ } else { return "This Command In-Player Only"; } if( !isset( $argments[0] ) ) { return "Invalid"; } if( isset( $argments[1] ) ) { foreach ($this->config["area_whiteworld"][$user->level->getName()] as $key => $builder) { if($builder == $user->username) { unset( $this->config["area_whiteworld"][$user->level->getName()][$key] ); $this->writeConfig(); } } return "Removed"; } if( isset( $this->config["area_whiteworld"][$user->level->getName()] ) ) { $this->config["area_whiteworld"][$user->level->getName()][] = $argments[0]; $this->writeConfig(); return $argments[0] . " Added to Builder on This World"; } else { return "Your World Not WhiteWorld"; } break; now, i'm at about a negative 10 skill level here, but here is my thought on how to make this work. line 4 of that snippet (return "This Command In-Player Only";) would need to be replaced with a translated version of next if statement, where the [$user->level->getName()] would be converted to a format that doesn't call on the $user (since it'll be run by the console, not a user) so i would then have to find some way to have the "areaworld" and "areabuilder" commands allow the console to provide the level name, as opposed to it getting the level name from what i assume is the users current level? i'm not looking for anyone to write the code for me, i just want to know if i'm on the right track in this assumption... the error i get when I remove the first if statement is "'Call to a member function getName() on a non-object'," - i'm assuming that $user->level->getName() isn't a proper object when it's not run by a user...? i may be in over my head here, but any other insights you might have would be greatly appreciated as well. again, please excuse my ignorance... i'll catch up eventually cheers, -u.
yes, i assumed as much. so i should, instead, attempt to either pull the default worldname or allow the console to specify the worldname when using the /areabuilder command. hmm... seems simple enough...
The default world name should be set to "world" anyway as far as I can see it.. I wonder how this will impact multi-world sections. Me confused now...