Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Plugin Debug?

Comments in 'Plugin Development' started by Radix, Aug 1, 2015.

Thread Status:
Not open for further replies.
  1. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Everything is fine but I don't know what is wrong..

    https://github.com/DarkRealms/HardCorePvP

    PHP:
    Code:
    [
    13]
    [
    14] class Main extends PluginBase implements Listener{
    [
    15]
    [
    16]  public function onEnable(){
    [
    17]  $this->getServer()->getPluginManager()->registerEvents($this$this);
    [
    18]  $this->saveDefaultConfig();
    [
    19]  }
    [
    20]
    [
    21]  public function onPlayerDeath(PlayerDeathEvent $event){
    [
    22]  $p $event->getPlayer();
    [
    23]  $pName $p->getName();
    [
    24]  $time $this->getConfig()->get("bantime");
    [
    25]  if (($tb $pm->getPlugin("TimerBan")) !== null) {
    [
    26]  $tb->banPlayer($p$time/60);
    [
    27]  $this->getServer()->broadcastMessage(TextFormat::YELLOW$pName" has been banned for "$time ." minutes");
    [
    28]  }else{
    [
    29]  $this->getLogger()->info("ERROR: NO TimerBan Plugin by ONEBONE!");
    [
    30]  $this->getServer()->broadcastMessage("ERROR: No TimerBanPlugin by ONEBONE");
    [
    31]  }
    [
    32]

    Im not understanding..
    PHP:
    ErrorCall to undefined method pocketmine\event\player\PlayerDeathEvent::getPlayer()
  2. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Ive been trying to fix this for an hour.. Im stuck
  3. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    Use
    PHP:
    $p $event->getEntity();
    Legoboy0215 and PEMapModder like this.
  4. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    <3
  5. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    Dude why are u not using my plugin? Is it not working?
    Legoboy0215 likes this.
  6. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Crashes the server on player death , I deleted all the crash dumps lol , && Didn't ban the player
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    Dafuq why it was working then?
  8. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Timerban doesn't work .. I got it to work but the timer ban dependency is what is messing up!
  9. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    whats $pm?
    Jon likes this.
  10. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    Try doing this:
    PHP:
    public function onDeath(PlayerDeathEvent $event){
    $banApi $this->getServer()->getPluginManager()->getPlugin('TimerBan');
    if(
    $banApi == null) return;
    $time 0.01
    $banApi
    ->banPlayer($event->getEntity(), $time /* Time in hours */);
    }
    Jon likes this.
  11. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Timerban it self doesn't work
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Timed ban is part of the PocketMine API. Why not use it directly?
    jojoe77777 likes this.
  13. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    where exactly ?
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
  15. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    ?
  17. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    He is talking to his 'dev'...
  18. Radix
    Offline

    Radix Active Member

    Joined:
    Jul 2, 2015
    Posts:
    211
    Minecraft User:
    Dicks123
    Best plugin dev i've ever met <3
    Legoboy0215 likes this.
Thread Status:
Not open for further replies.

Share This Page

Advertisement