Hola well im muy muy novato en estos temas Y no hablo muy bien Inglés, pero im going para probar! : P. Bueno mi pedir su siguiente. Voy a hacer un plugin its will be called friendly, you can add friends and enemys. Tengo el código de complemento than you can add the friends and enemys to a list and you can see the list but i whant to. Invite friend to my position Vea si su línea Y cuando puedo añadir a mi lista enviar mensaje receptor and return a answer like XScripter0 quiere ser tu amigo yo puedo write /fnyes or /fnno. No es mi código: PHP: <? Php/ *__PocketMine Plugin__name = AmistosoDescripción = Plugin por XScripter0!version = 1.0author = XScripter0class = amigableapiversion = 13* /implementos amigables clase de complemento { $ api privado, $ ruta; public function __ construct ($ ServerAPI api, $ server = false) { $ This -> api = $ api; } public function init () { $ This -> api -> Consola -> registro ("fnlist", "Da lista de sus amigos un enemys", array ( $ This, "Amigos" )); $ This -> api -> prohibición -> cmdwhitelist ("fnlist"); $ This -> path = $ this -> api -> Plugin -> configPath ($ this); $ This -> amigos = new Config (. $ This -> path "friends.yml", CONFIG_YAML, array ()); $ This -> enemys = new Config (. $ This -> path "enemys.yml", CONFIG_YAML, array ()); $ This -> api -> Consola -> registre ("fnadd", "Añadir un nuevo amigo", array ( $ This, "FriendAdd" )); $ This -> reload (); } friendlist función pública ($ cmd, $ args, $ emisor) { if ($ emisor instanceof Player) { $ This -> reload (); $ Usuario = $ emisor -> nombre de usuario; $ This -> api -> chat -> SENDTO (false, $ msg, $ usuario); $ msg1 = "[Friedly] Amigos:". implosión ("", $ this -> amigos); $ This -> api -> chat -> SENDTO (false, $ msg1, $ usuario); $ Msg2 = "[Amistoso] enemys:". implosión ("", $ this -> enemys); $ This -> api -> chat -> SENDTO (false, $ msg2, $ usuario); } else { $ Salida = "Por favor, ejecute este comando en el juego hasta que llegue el momento de escribir esta parte: p"; return $ resultados; } } función pública FriendAdd ($ cmd, $ args, $ emisor) { switch ($ args [0]) { caso "amigo": caso "f": $ Target = $ args [1]; array_push ($ this -> dueño, $ target); $ This -> owner = $ this -> api -> Plugin -> writeYAML (. Estos $ -> path "friends.yml", $ destino); volver "Agregado". $ Target. "Como su nuevo amigo"; romper; caso "enemigo": caso "e": $ Target = $ args [1]; array_push ($ this -> admins, $ target); $ This -> Administradores = $ this -> api -> Plugin -> writeYAML ($ this -> path "enemys.yml", $ target.); volver "Agregado". $ Target. "Como administrador"; romper; por defecto: $ Salida = "Uso: / friendadd <f|e> <full usuario>"; return $ resultados; } } función pública reload () { $ This -> amigos = $ this -> api -> Plugin -> readYAML (. $ This -> path "friends.yml"); $ This -> enemys = $ this -> api -> Plugin -> readYAML ($ this -> path "enemys.yml."); } public function __ destruct () { }} [/ PHP]¿Cómo puedo completar el otro código o por favor me ayude a dicho cómo puedo empezar.Gracias! :)[/B]
Sorry for the double post but my cell traduce all thr post i was saying: Hi well im very very noob in that topic And im not speak very much english, im going to try! : P. Well my dude its the next.I making a plugin its called friendly, you add friends and enemys. I have the start code than you can add the friends and enemys to a list and you can see the list but i whant to: Invite friend to my position If its online ...And more but in others versions... And when you add a new user in your list send a message to the user and return a answer like XScripter0 whant add you like a friend and the user can write /fnyes or /fnno. If the user type /fnyes it goin to add in the list but if write /fnno it goin to cancel The list adding!. Well if you can help me to conllete these plugiuns im goin be very very thanks you. Thanks!!
Sorry i forget that! The code: PHP: <?php/*__PocketMine Plugin__name=Friendlydescription=Plugin by XScripter0!version=1.0author=XScripter0class=friendlyapiversion=13*/class friendly implements plugin{ private $api, $path; public function __construct(ServerAPI $api, $server = false) { $this -> api = $api; } public function init() { $this -> api -> console -> register("fnlist", "Gives list of your friends an enemys", array( $this, "FriendList" )); $this -> api -> ban -> cmdwhitelist("fnlist"); $this -> path = $this -> api -> plugin -> configPath($this); $this -> friends = new Config($this -> path . "friends.yml", CONFIG_YAML, array()); $this -> enemys = new Config($this -> path . "enemys.yml", CONFIG_YAML, array()); $this -> api -> console -> register("fnadd", "Add a new friend", array( $this, "FriendAdd" )); $this -> reload(); } public function FriendList($cmd, $args, $issuer) { if($issuer instanceof Player){ $this -> reload(); $username = $issuer -> username; $this -> api -> chat -> sendTo(false, $msg, $username); $msg1 = "[Friedly] Friends: " . implode(", ", $this -> friends); $this -> api -> chat -> sendTo(false, $msg1, $username); $msg2 = "[Friendly] Enemys: " . implode(", ", $this -> enemys); $this -> api -> chat -> sendTo(false, $msg2, $username); } else{ $output = "Please run this command in-game until I get time to write this part :p"; return $output; } } public function FriendAdd($cmd, $args, $issuer) { switch($args[0]) { case "friend" : case "f" : $target = $args[1]; array_push($this -> owner, $target); $this -> owner = $this -> api -> plugin -> writeYAML($this -> path . "friends.yml", $target); return "Added " . $target . " as your new friend"; break; case "enemy" : case "e" : $target = $args[1]; array_push($this -> admins, $target); $this -> admins = $this -> api -> plugin -> writeYAML($this -> path . "enemys.yml", $target); return "Added " . $target . " as an admin"; break; default : $output = "Usage: /friendadd <f|e> <full username>"; return $output; } } public function reload() { $this -> friends = $this -> api -> plugin -> readYAML($this -> path . "friends.yml"); $this -> enemys = $this -> api -> plugin -> readYAML($this -> path . "enemys.yml"); } public function __destruct() { }}
Este es el foro oficial de PocketMine, hay muchisimos mas, pero los mejores desarrolladores estan solo aquí, aparte no encontraras ninguno que hable solo español, aqui se habla: Inglés Español Ruso Chino Koreano Y muchos más xD (Pero te pedire que trates de hablar solo en inglés, asi te podran ayudar mejor y tu mejoraras tu nivel de ingles )