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

Get area from areas file

Comments in 'Plugin Development' started by mariusbjornor, Aug 8, 2015.

  1. mariusbjornor
    Offline

    mariusbjornor Active Member

    Joined:
    Jan 6, 2015
    Posts:
    109
    Minecraft User:
    MariusB
    Im making a simple plugin for my own use together with @LDX 's iProtector..

    I need help with a code to get area data from areas.json upon a command..

    Idea is to do like this:

    /area here

    then plugin retrieves data from areas.json to see if your standing inside a area thats registered. if you are, plugin returns something like this:

    Your currently in area: Spawn

    if not it returns something like this:

    No area registered here

    I first thought i could do something similar to iProtectors list command but i dont know how to put in that it need to look if players is in an area, and not list all..

    PHP:
      case "list":
      if(
    $p->hasPermission("iprotector") || $p->hasPermission("iprotector.command") || $p->hasPermission("iprotector.command.area") || $p->hasPermission("iprotector.command.area.list")) {
      
    $o "Areas:";
      foreach(
    $this->areas as $area) {
      
    $o $o " " $area->getName() . ";";
      }
      }
    Thanks for all help :-D

Share This Page

Advertisement