PHP: $c = $this->getConfig();if(!($c->get("m1s1") == $event->getPlayer()->getName())){$c->set("m1s1", $event->getPlayer()->getName());$c->save();}
If there is a red pencil in the box, change the box's content to a red pencil. Did anything get changed, the box originally having a red pencil or not?
But it means if in the config in m1s1 isnt the playername it set the playername in m1s1 in the config
No it won't. You see this line? You are only executing the code below if m1s1 is the player name. Did you actually mean != or !== ?
Okay whats the correct version? I want if the player isnt in the config at m1s1 that his name will putted in the config in m1s1
If player name is not at m1s1 That means, if m1s1 is not equal to player name That means, if player name !== value of m1s1, right?
What is if I want that the player will be only inputted in m1s1 or if in m1s1 an another player is that the player will be inputted in m1s2? PHP: if($cf->get("m1s1") !== $event->getPlayer()->getName()){$cf->set("m1s1", $event->getPlayer()->getName());}if($cf->get("m1s2") !== $event->getPlayer()->getName()){$cf->set("m1s2", $event->getPlayer()->getName());}
PHP: if($m1s1 !== $name){ $m1s1 = $name;}else{ $m1s2 = $name;} But you can achieve this more easily through an array.
@PEMapModder I have an problem, the player will be inputted in m1s1 and m1s2 and I want that he will only inputted in one of they two like: PHP: m1s1: player1m1s2: player2and notm1s1: player1m1s2: player2 And no I'm to dump for arrays
I assume you're creating 1 versus 1 duel plugin, right? If so, it's not necessary to write data immediately.
But without multiworld and the plugin sends the players the message so: PHP: $this->getServer()->getPlayer($this->getConfig()->get("m1s1"))->sendMessage("Youre Player1");$this->getServer()->getPlayer($this->getConfig()->get("m1s2"))->sendMessage("Youre Player2");$this->getServer()->getPlayer($this->getConfig()->get("m1s3"))->sendMessage("Youre Player3");$this->getServer()->getPlayer($this->getConfig()->get("m1s4"))->sendMessage("Youre Player4"); And if the player klicks on the sign : PHP: if($cf->get("m1s1") !== $event->getPlayer()->getName()){$cf->set("m1s1", $event->getPlayer()->getName());}if($cf->get("m1s2") !== $event->getPlayer()->getName()){$cf->set("m1s2", $event->getPlayer()->getName());}if($cf->get("m1s3") !== $event->getPlayer()->getName()){$cf->set("m1s3", $event->getPlayer()->getName());}if($cf->get("m1s4") !== $event->getPlayer()->getName()){$cf->set("m1s4", $event->getPlayer()->getName());} But if the player klicks on the sign the player1's name will be inputted in m1s1 and m1s2 and m1s3 and m1s4