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

Help with command positions.

Comments in 'Plugin Development' started by 0neGam3r, Jul 25, 2016.

  1. 0neGam3r
    Offline

    0neGam3r New Member

    Joined:
    Aug 26, 2015
    Posts:
    23
    Minecraft User:
    0NEGAM3R
    As I can make it through a command define the positions of the players?

    for example $pos1,$pos2,$pos3.. etc


    I am looking for a minigame that I am creating :p
    Sorry for my English I am using a translator and thanks for reading and for your help.
    Last edited: Jul 25, 2016
  2. andre_the_gamer
    Offline

    andre_the_gamer Active Member

    Joined:
    Feb 5, 2015
    Posts:
    112
    Minecraft User:
    Andre_The_Gamer
    What do you mean?
  3. 0neGam3r
    Offline

    0neGam3r New Member

    Joined:
    Aug 26, 2015
    Posts:
    23
    Minecraft User:
    0NEGAM3R
    I mean this:

    PHP:
    public function onCommand(CommandSender $senderCommand $command$label, array $args) {
            switch (
    strtolower($command->getName())){
                case 
    "pos":
                         
    //to define the positions of spawning players
                   
                    
    break;


  4. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    if $sender is a player, it is a position itself.

    https://forums.pocketmine.net/threads/new-api-get-full-player-position.4898/
  5. 0neGam3r
    Offline

    0neGam3r New Member

    Joined:
    Aug 26, 2015
    Posts:
    23
    Minecraft User:
    0NEGAM3R
    Last edited: Jul 25, 2016
  6. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    You are probably looking for an array rather than many hardcoded variables to hold the positions. Say, if you are making a hunger games plugin, you don't want to define 24 variables in code, but make an array with 24 values instead, using foreach or array_map().
    0neGam3r and Survingo like this.
  7. 0neGam3r
    Offline

    0neGam3r New Member

    Joined:
    Aug 26, 2015
    Posts:
    23
    Minecraft User:
    0NEGAM3R
    Thanks @SOFe

Share This Page

Advertisement