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

Array for each Player

Comments in 'Plugin Development' started by JackboyPlay, Feb 26, 2016.

  1. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    How can I create an array for each Player with 2 Coordinates and how can I get the distance between the 2 Positions?
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    array(
       
    "Player" => array(
           
    $cord1,
           
    $cord2
      
    )
    );
    While $cord1 and $cord2, of course, are your two coordinates.
    PHP:
    $pos1->distance($pos2);
    // Or
    $pos1->distanceSquared($pos2);
    While $pos1 and $pos2, of course, are your two positions
    applqpak likes this.
  3. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    @CraftYourBukkit is the array automaticly for more than 1 Player at the same time?
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Please take a look at this: Click here
    Sean_M, PEMapModder and applqpak like this.
  5. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Thanks but you can answer yes or no!
  6. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I know I can, but that means you wouldn't do anything by yourself. :)
  7. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay

Share This Page

Advertisement