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

help

Comments in 'Plugin Development' started by TryoneLegendZzz, Sep 19, 2015.

  1. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    ok so i am getting an error that it expects strtolower with this code
    PHP:
    $array $this->players;
    $randomPlayer array_rand($array1);
    array_push($this->vip$randomPlayer);
    $person=$this->getServer()->getPlayer($this->vip);
    $person->sendMessage("You Are The Bounty");
    $person->setNameTag("[Bounty]".$person->getName());
    $person->teleport($this->vipSlot);
  2. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    Post the error in a code block Plz
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    $this->vip is an array (it should be) so you can not get Player by array.
    so maybe
    PHP:
    $array $this->players;
    $randomPlayer array_rand($array1);
    $this->vip[] = $randomPlayer;
    $person $this->getServer()->getPlayer($this->vip);
    $person->sendMessage("You Are The Bounty");
    $person->setNameTag("[Bounty]".$person->getName());
    $person->teleport($this->vipSlot);
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Try
    PHP:
    $person $this->getServer()->getPlayer($this->vip[$randomPlayer]);
  5. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    you don't know what is $players variable xD
  6. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    There is no $players variable
  7. Lambo
    Offline

    Lambo Notable Member Plugin Developer

    Joined:
    Sep 14, 2013
    Posts:
    431
    Plugins:
    4
    Minecraft User:
    Lambo
    Please post all of your code. And the error. Also, use $this->vips[] because instead of array_push
    - it is faster
    - it looks better :)
    PEMapModder and BalAnce like this.
  8. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    No use telling him, because some people assume we're all mind readers and that we know exactly what the non-posted code is.
    Last edited: Sep 19, 2015
  9. Deathcrow
    Offline

    Deathcrow Active Member

    Joined:
    Aug 20, 2015
    Posts:
    61
    Minecraft User:
    Deathcrow
    Its a common mistake :) people assume bc your plugin developer that your automatically gonna be able to know what was done wrong :p
  10. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    No use if he doesn't post the full code. If I gave you this:
    PHP:
    function sayHello(){
        echo 
    "Say hello";
    }
    And I told you to find what kept causing "Invalid Argument: Array required, object given" wouldn't you have asked the person who asked the question about the code the question? :p
  11. basprohop
    Offline

    basprohop Active Member Plugin Developer

    Joined:
    Aug 8, 2015
    Posts:
    128
    Plugins:
    3
    Minecraft User:
    basprohop
    You I believe you have that error on line number 420
  12. Deathcrow
    Offline

    Deathcrow Active Member

    Joined:
    Aug 20, 2015
    Posts:
    61
    Minecraft User:
    Deathcrow
    Im saying its a mistake people eith absolutly no knowledge tend to believe in developers are "no longer human"

Share This Page

Advertisement