i get the special but not the variables in between. PHP: <?phpnamespace Buff;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\Player;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\utils\Config;use pocketmine\event\player\PlayerJoinEvent;use pocketmine\command\ConsoleCommandSender;class Main extends PluginBase implements Listener{ public function onEnable() { $this->getServer()->getPluginManager()->registerEvents($this, $this); @mkdir($this->getDataFolder()); $this->cfg = new Config($this->getDataFolder() . "sp.yml", Config::YAML); } public function onJoin(PlayerJoinEvent $event) { $player = $event->getPlayer(); $name = $player->getName(); if($this->cfg->get($name) !== null) { $this->ss = $this->cfg->get($player.'+s'); $this->sp = $this->cfg->get($player.'+p'); $this->se = $this->cfg->get($player.'+e'); $this->sc = $this->cfg->get($player.'+c'); $this->si = $this->cfg->get($player.'+i'); $this->sa = $this->cfg->get($player.'+a'); $this->sl = $this->cfg->get($player.'+l'); $this->sx = $this->cfg->get($player.'+ex'); }else{ $this->cfg->set("$name+s",0); $this->cfg->set("$name+p",0); $this->cfg->set("$name+e",0); $this->cfg->set("$name+c",0); $this->cfg->set("$name+i",0); $this->cfg->set("$name+a",0); $this->cfg->set("$name+l",0); $this->cfg->set("$name+ex",40); $this->cfg->set("$name lock", false); $this->cfg->save(); } } public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args): bool { switch ($cmd->getName()) { case 'sp': $sender->sendMessage("S:$this->ss, P:$this->sp, E:$this->se, C:$this->sc, I:$this->si, A:$this->sa, L:$this->sl, Extra:$this->sx"); break; case 'set': $slk = $this->cfg->get("$sender lock"); if($slk == false) { if($args[1] == 's' or $args[1] == 'S') { $this->cfg->set("$sender +s", $args[2]); $this->sx -= $args[2]; $this->cfg->set("$sender +ex",$this->sx); $this->cfg->save(); } }else{ $sender->sendMessage('gay'); } break; } return true; }}?>[/CODE]
Oh my god that code physically hurts me and the childish error message for non-lock players is just the cherry on top. As for fixing your issue, you need to use $sender->getName()
So I put the $sender->getName() instead of what? also i am not gonna keep the word in there for non locked players xd
Ditch that, the whole code is awful and not going to work without significant changes, I don't have time to do that right now, maybe ask someone one Discord