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

Download plugin and load from web.

Comments in 'Plugin Development' started by EkiFoX, Mar 8, 2014.

  1. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    94
    Plugins:
    2
    Minecraft User:
    ekifox
    i use:
    PHP:
    $load Utils::curl_get("http://website/plugin.php");
    $this->api->plugin->load($load);
    and this not work!
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    The second function will take a URL and fetch the plugin for you.
  3. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    @Falk So then I need to use
    Code:
    $this->api->plugin->load(https://raw.github.com/PocketMine/SimpleAuth/master/SimpleAuth.php);
    to load (For example) SimpleAuth from web and not from a saved file? or that doesn't work? :p
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Yeah, exactly that, but remember the quotes :)
  5. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    @Falk then:
    Code:
    $this->api->plugin->load("https://raw.github.com/PocketMine/SimpleAuth/master/SimpleAuth.php");
    Falk likes this.
  6. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    @Falk How can I get the number of players online? I used
    Code:
    $this->api->player->getAll() >= 10
    to start a function only if there are 10 or more players on, but it doesn't work, the function also start with 0 players online, any ideas?
  7. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Try using count:
    PHP:
    if(count($this->api->player->getAll()) >= 10){
    //Code here
    }
    EkiFoX likes this.
  8. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Another question:
    I want to change the value of a variable named $timer, I have this:
    Code:
    public function commandHandler($cmd, $params, $issuer, $alias){
            $output .= "";
              
            if(!($issuer instanceof Player)){
                switch($params[0]){
                    case "":
                        $output .="Use: /hg set";
                        break;
                    case "set":
                        $this->tiemer = $params[0];
                        $output .= "Tiempo cambiado";
                        break;
                }
            }
            return $output;
        }
    it change the value and stop the server, what I need to do?

    EDIT: I only changed
    Code:
    $this->timer = $params[0];
    to [1] and now work :D
  9. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    94
    Plugins:
    2
    Minecraft User:
    ekifox
    I want to put in internet plugin - the walls
  10. EkiFoX
    Offline

    EkiFoX Active Member Plugin Developer

    Joined:
    Feb 28, 2014
    Posts:
    94
    Plugins:
    2
    Minecraft User:
    ekifox
    $cmd => hg
    $params[0] => set
    $params[1] => 15 (ex. time)
  11. Men'o'Gang!
    Offline

    Men'o'Gang! Ban Evader Banned

    Joined:
    Mar 3, 2014
    Posts:
    18
    is imposible to read online plugins becuz always there will be html code that it wont let load or just if it downloads the plugin may load it
  12. Men'o'Gang!
    Offline

    Men'o'Gang! Ban Evader Banned

    Joined:
    Mar 3, 2014
    Posts:
    18
    and website/plugin.php is nothing or is just a not showing link ?
  13. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    He was using it as an example. -_-
  14. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Does this method work with Linux? I know that file_get_contents() doesn't work on Linux for web addresses.
  15. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I didn't know that :(
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    As I recall, https does not work. Http has to be used instead.

Share This Page

Advertisement