I needa code for a sign that when I put {aaa} on it it runs the code... THIS IS NOT CORRECT CODE OR WAT THIS IS EXAMPLE FOR U TO UNDERSTAND, IM TELLING THIS TO U PEMAP IF UR READIN THIS $loul = sign(getText"{aaa}"); $loul = the code also please add the code from public function
in sign when you enter {aaa} on it it runs the code, so example we got the code getting online players in world if you did this to sign LINE1: Hub LINE2: <players on> LINE3: {aaa} LINE4: null and when you enter LINE1: Hub LINE2: <Players on> LINE3: 1 LINE4: null
You've made a million(exaggeration(or not?)) threads asking for help, maybe you should really spend a good few weeks/months studying proper PHP and proper PocketMine API?
This is how I learn you cant (controll(or ask)) waht should I do because every people has different types
PHP: public function SignChange(SignChangeEvent $e){$l = $e->getLines(); $l = implode(" ", $l); $server = $this->getServer(); $l = str_replace("{aaa}", count($server->getOnlinePlayers()), TextFormat::clean($l)); $line = 3;//line you want (0=Line 1, 1=Line 2, 2=Line 3, 3=Line 4); $e->setLine($line, $l);}
Im trying to learn on code academy while wwtching someone its hard for me to learn in php.net so atm I use to copy and mix and remember the codes ive seen in my eyes thats why I've been asking alot for different codes because I can use them for different purposes like this one
Example PHP: public function onSign(SignChangeEvent $event){ $sign = $event->getLines(); // getLines() will return an array of lines if($sign[0] == '[example]'){ // Check if the first line is [example] $event->setLine(0, 'Hub'); // Change the first line $event->setLine(1, 'test'); // Change the second line }}
I never said I could/would/want to control how you learn, everyone has their own learning styles. It was a simple suggestion, and, if you can't take a suggestion, how the heck are you going to develop good plugins?