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

RandomItem 4.3

Gives a random item on command and at set intervals.

  1. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    I'm sorry, but I don't think I want my plugin to be given away uncounted. :( Sorry!
  2. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    What do you mean ?? you get credit !
  3. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Yeah, but people may download your pack for a certain plugin or two (none of which are mine) and when someone downloads my plugin from within yours, it wouldn't add 1 to MY download count.
  4. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    Pleasee , Pleaseee
    PHP:
    class kits implements Plugin {
    private 
    $api;
    public function 
    __construct(ServerAPI $api$server false) {
    $this->api $api;
    }

    public function 
    init() {
    $this->api->addHandler("player.block.touch", array($this"touchHandler"), 15);
        }
        public function 
    touchHandler($data$event) {
            
    $dataTarget $data["target"];
            if (
    $dataTarget->getID() === 41) {
            
    $this->api->console->run("give ".$data["player"]->username." 298 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 299 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 300 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 301 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 2 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 261 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 262 32""console"false);   
            
    $this->api->console->run("give ".$data["player"]->username." 260 5""console"false);
            
    $this->api->console->run("tell ".$data["player"]->username." Your kit has been given !""console"false);
            }
            else if (
    $dataTarget->getID () === 42) { // iron block
            
    $this->api->console->run("give ".$data["player"]->username." 142 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 272 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 273 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 274 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 275 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 328 1""console"false);
            
    $this->api->console->run("give ".$data["player"]->username." 345 1""console"false);   
            
    $this->api->console->run("give ".$data["player"]->username." 314 5""console"false);
            
    $this->api->console->run("tell ".$data["player"]->username." Your kit has been given !""console"false);
            }
            return 
    true;
        }
        public function 
    __destruct(){
        }
    }
    /*
    Random Item's By: LDX

    */
    class random implements Plugin {
    private 
    $api;
    public function 
    __construct(ServerAPI $api$server false) {
    $this->api $api;
    }

    public function 
    init() {
    this->api->console->register("gift","Gives a random item to everyone online.",array($this"giveRI"));
    $this->api->schedule(12000,array($this,"giveRI"),array(),true,"server.schedule");
    $this->config = new Config($this->api->plugin->configPath($this) . "config.yml",CONFIG_YAML,array("0" => "360","1" => "267","2" => "265","3" => "354","4" => "6"));
    console("[INFO] RandomItem Enabled!");
    }

    public function 
    __destruct(){}

    public function 
    giveRI() {
    $RIA = array($this->config->get("0"),$this->config->get("1"),$this->config->get("2"),$this->config->get("3"),$this->config->get("4"));
    $RIN rand(0,4);
    $randItem $RIA[$RIN];
    $this->api->console->run("give @all " $randItem " 1");
    $this->api->chat->broadcast("[RandomItem] Random item given! (ID: " $randItem ")");
    }
    }
    ?>
  5. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Um, it's just a little creepy how you wrote this plugin without asking me first...
    Let me think on it for a minute...
  6. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    Yaay , Im adding other plugins also !
  7. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Maybe I should update KitPro :p
  8. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    My your kit plugin too ? I might just make a
    Essentials like this ? Kinda like kevins but much better !!
  9. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    Please rephrase the question, if you are asking to use KitPro, the answer is no
  10. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    Ok , well are you willing to make a plugin with me ? Im not so good with PHP , Im use to making modpe scripts :D
  11. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    I will contribute a little bit, if you put it on GitHub
  12. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    Well no scratch that ! Im not good with PHP , ! Want to make a mod ?
  13. Glitchmaster_PE
    Offline

    Glitchmaster_PE Notable Member Plugin Developer

    Joined:
    Aug 31, 2013
    Posts:
    834
    Plugins:
    8
    Minecraft User:
    Glitchmaster_PE
    No, not really
  14. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Lol IJDEK. So wait, does that mean you don't want my code anymore?? :D
  15. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    @LDX , I do ! lol and ok Glitchmaster
  16. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    I'm still thinking about it...
  17. ShaderHD
    Offline

    ShaderHD Banned

    Joined:
    Aug 23, 2013
    Posts:
    23
    Plugins:
    1
    Minecraft User:
    ShaderGameing
    Ok ?
  18. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    I decided you can NOT use my code.
    Xfusionios likes this.
  19. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    LDX updated RandomItem with a new update entry:

    Time config

    Read the rest of this update entry...
  20. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14

Share This Page

Advertisement