As for the invisibility plugin, I remember 500ise talking about this... He said something about stopping the server from updating the location of the player model, but I don't remember much else. Sorry. Congrats on your first plugin though!
Rollback Post to RevisionRollBack
Java/C/C++ dev, server owner and hacker extraordinare
hey i have a question, how do i broadcast something directly to the player when they use a certain command? Lets say for example im making a simple plugin to broadcast the rules of the server only to the player who uses the command. I can make the console say it or make it say it to everyone but i havent figured out how for just the one player, any help would be appreciated.
say awww yesss, ive been searching for this line of code lol, Im getting pretty familiar with php but im not 100% on the pocketmine API and how to call objects and everything lol, Thank you im going to test the plugin now, when its finished i will post it for everyone to use on their servers : )
I've got a question. I'm making a simple little plugin command and I just need the code so that when u enter the specific command it would give u a item that you set in the code.(I do not need config) thanks. This tutorial helped me alot.
hey i have a question, how do i broadcast something directly to the player when they use a certain command? Lets say for example im making a simple plugin to broadcast the rules of the server only to the player who uses the command. I can make the console say it or make it say it to everyone but i havent figured out how for just the one player, any help would be appreciated.
On my NPC plugin, when you use the spawn, or remove command it broadcasts (serverwide) they say either hello or bye. I can send you an example of my code if you want. I can edit it so it only sends to one player and show you the code PM Me?
hey could someone help me with this bit as well
im not getting any error codes and it is displaying the message
but it will not heal the player...confused
<?php
/*
__PocketMine Plugin__
name=Medkit
description=Tap a Glowing Obsidian to heal yourself!
version=0.1.0
author=iParadox
class=TouchCommand
apiversion=9
*/
/*
Small Changelog
===============
0.1.0: Initial release
*/
class TouchCommand implements Plugin{
private $api;
public function __construct(ServerAPI $api, $server = false){
$this->api = $api;
}
public function init(){
$this->api->addHandler("player.block.touch", array($this, "touchHandler"), 15);
}
public function touchHandler($data, $event) {
$dataTarget = $data["target"];
if ($dataTarget->getID() === 246) {
$this->api->entity->heal($data["player"]->username. 10, "console", false);
$this->api->console->run("tell ".$data["player"]->username." You are fully healed", "console", false);
}
return true;
}
public function __destruct(){
}
}
Ok so ive tried making a simple AFK plugin so when they do /afk it broadcasts the Player is AFK but everytime i do the command it crashes the server. Could someone please help. Thanks in advance. It does not give me errors on startup.
<?php
/*
__PocketMine Plugin__
name=AFK Plugin
version=0.0.1
author=Xfusionios
class=AfkPlugin
apiversion=9
*/
class AfkPlugin implements Plugin{
private $api;
public function __construct(ServerAPI $api, $server = false){
$this->api = $api;
}
public function init(){
$this->api->console->register("afk", "tells everyone your AFK", array($this, "afk"));
}
public function __destruct(){
}
public function afk($cmd, $arg, $issuer, $alias){
switch($cmd){
case "afk":
$user = strtolower($args[0]);
$this->API->chat->broadcast("User " .$user. ". is now AFK!");
break;
}
}
}
api is without capital letters, so it needs to be:
$this->api->chat->broadcast("User " .$user. ". is now AFK!");
Thanks such a simple mistake but you are awesome thanks a million!! You are really helpful and a plugin MASTER!
Alos sorry one more question how could i track aplyer movement say after they start moving after the enter the /afk command how would i get so it say
$this->api->chat->broadcast("User " .$user. ". is no longer AFK!");
Another quick question not relating to the code. How come you dont make public plugins because your like a Plugin GOD. You could make a some really awesome stuff. I know you make PMChero plugins but you should make public one too. Your just so great!!!!
Thanks again! Your the best!
Beyond my skills right now but that definately sounds like something that can be done, ill try my best any help from the more skilled devs would be appreciated. And weiz is there a way we can send a default texture directly to the player? If thats possible then your redstone plugin would be amazing
ive only made a few simple ones so far, i still dont know what the limits are, have you asked the creator? maybe he can work around it, it would add so much more to the game if he could.
that is very unfortunate...i mean if you are playing with a select group you could make a texture pack and have them all use it but its not very practical for a normal server : (
Java/C/C++ dev, server owner and hacker extraordinare
Java/C/C++ dev, server owner and hacker extraordinare
$this->api->console->run("give ".$data["player"]->username." ITEM.ID ITEM.AMOUNT", "console", false);
example
$this->api->console->run("give ".$data["player"]->username." 264 1", "console", false);
this when used as a command output it will give the issuer 1 diamond gem.
Yes I was running this before but it could not fine th is username but I figured it out. Thanks for helping!
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
Hey, i think u wrote the tut wrongly a bit.
For all <yeah should be> programming languages, in an "if/else/elseif" statement, when comparing a variable like
Notice that it is === and not =?
In your first tut, it seems that u used = instead of === or ==.
== and === can be used while comparing variables too.
= cannot be used as it would always return as True
Check out my game! It's an open-world, sandbox text adventure.
Follow @hexdro_
Hexdro © 2012-2015
Thanks. I haven't been able to edit this that much because my internet has been sporadic.
Java/C/C++ dev, server owner and hacker extraordinare
im not getting any error codes and it is displaying the message
but it will not heal the player...confused
Thanks such a simple mistake but you are awesome thanks a million!! You are really helpful and a plugin MASTER!
Alos sorry one more question how could i track aplyer movement say after they start moving after the enter the /afk command how would i get so it say
Another quick question not relating to the code. How come you dont make public plugins because your like a Plugin GOD. You could make a some really awesome stuff. I know you make PMChero plugins but you should make public one too. Your just so great!!!!
Thanks again! Your the best!
Java/C/C++ dev, server owner and hacker extraordinare