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

FactionsPro need help

Comments in 'Plugin Development' started by PolskiTHEPLAYER, Apr 11, 2016.

  1. PolskiTHEPLAYER
    Offline

    PolskiTHEPLAYER New Member

    Joined:
    Apr 1, 2015
    Posts:
    55
    Minecraft User:
    Flsmers
    PHP:
    if($args[0] == "create") {
                            if(
    $this->plugin->commands->get("/f create") == false) {
                                
    $sender->sendMessage($this->plugin->formatMessage("This command has been disabled, please ask\nan Admin if you think this is a mistake."));
                                return 
    true;
                            }
                            if(!isset(
    $args[1])) {
                                
    $sender->sendMessage($this->plugin->formatMessage("Usage: /f create <faction name>"));
                                return 
    true;
                            }
                            if(!(
    ctype_alnum($args[1]))) {
                                
    $sender->sendMessage($this->plugin->formatMessage("You may only use letters and numbers!"));
                                return 
    true;
                            }
                            if(
    $this->plugin->isNameBanned($args[1])) {
                                
    $sender->sendMessage($this->plugin->formatMessage("This name is not allowed."));
                                return 
    true;
                            }
                            if(
    $this->plugin->factionExists($args[1]) == true ) {
                                
    $sender->sendMessage($this->plugin->formatMessage("Faction already exists"));
                                return 
    true;
                            }
                            if(
    strlen($args[1]) > $this->plugin->prefs->get("Maximum Faction Name Length")) {
                                
    $sender->sendMessage($this->plugin->formatMessage("This name is too long. Please try again!"));
                                return 
    true;
                            }
                            if(
    $ses->inFaction()) {
                                
    $sender->sendMessage($this->plugin->formatMessage("You must leave this faction first"));
                                return 
    true;
                            } else {
                                
    $factionName $args[1];
                                
    $f = new Faction($this->plugin$args[1], $sender->getPlayer()); //TODO: Split into two lines
                                
    $ses->updateFaction();
                                
    $sender->sendMessage($this->plugin->formatMessage("Faction successfully created!"true));
                                return 
    true;
                            }
                        }

    How add to factionspro buy faction for item 
    Sorry 
    for my english
  2. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    First off, do not put question into the code block.
    For making transaction system, read the API of the plugin you want it to be compatible with. Then, use if functions to make sure that the player meets certain conditions. (Sufficient cash, spaces in the inventory, etc) After that, give player the item.
    Last edited: Apr 15, 2016
    KubixQ, IcePL, Muqsit and 1 other person like this.
  3. IcePL
    Offline

    IcePL New Member

    Joined:
    Feb 16, 2016
    Posts:
    73
    Minecraft User:
    IcePL
    Learn pocktmine api.
  4. KubixQ
    Offline

    KubixQ Active Member

    Joined:
    Sep 13, 2015
    Posts:
    85
    Minecraft User:
    KubixQ
    This post are unhelpful.
    Read Plugin Development rules.

Share This Page

Advertisement