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

Can a developer take a look at my plugin?

Comments in 'Plugin Development' started by BlubberBoy333, Apr 9, 2015.

  1. BlubberBoy333
    Offline

    BlubberBoy333 Active Member

    Joined:
    Aug 31, 2014
    Posts:
    177
    Minecraft User:
    Blubberboy333
    I am making a plugin that kicks players from the game when they kill another player. I have the code written but I need someone who knows what they're doing to look at it, and tell me if I messed and where I messed up. If anyone could help me, start a thread with me and i'll give you the code. Thanks :D
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    And you are starting a thread asking people to start a thread to ask you while you are the one asking?
    Why don't you just put the code here?
    hoyinm14mc likes this.
  3. BlubberBoy333
    Offline

    BlubberBoy333 Active Member

    Joined:
    Aug 31, 2014
    Posts:
    177
    Minecraft User:
    Blubberboy333
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    1. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L44 Undefined variable $eventPvP
    2. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L44 It is EntityDamagedByEntityEvent
    3. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L65 I think public is implicit, but better add the modifier back.
    4. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L65 Read the docs at http://jenkins.pocketmine.net/job/PocketMine-MP-Doc/doxygen or the PocketMine source at https://github.com/PocketMine/PocketMine-MP/tree/master/src/pocketmine/event . You can find all the events in these places. It is PlayerDeathEvent.
    5. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L67 Check $event->getEntity()->getLastDamageCause() instanceof EntityDamageByEntityEvent
    6. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L71 You are checking the same thing twice?
    7. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L75 Undefined field OPKilling. Do you know what you are doing?
    8. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L75 What is !$player == OP?
      1. If you want to check unequal, use $a != $b not !$a == $b
      2. Undefined constant OP
      3. Use $player->isOp() instead
      4. Generally, in plugins, you should check whether the player has a certain permission node rather than whether the player is op.
    9. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L80 What? Remove? You should use $player->kick() for kicking, and they should not be in a chained call.
    10. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L81-83 What are these?
    11. https://github.com/Blubberboy333/KillBan/blob/master/src/bluberboy/main.php#L86 Seems like you have a double indent?
    Samueljh1, hoyinm14mc, xiaoq and 2 others like this.
  5. BlubberBoy333
    Offline

    BlubberBoy333 Active Member

    Joined:
    Aug 31, 2014
    Posts:
    177
    Minecraft User:
    Blubberboy333
    How do you find out if a player has a permission node?
  6. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    PHP:
    Player $player->hasPermission("permission.node");
    Example:
    PHP:
    if($player->hasPermission("hi"){
      
    $player->sendPopup("HI!");
    }

Share This Page

Advertisement