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

Door Help

Comments in 'Plugin Development' started by DimazzzzZ, Feb 14, 2014.

  1. DimazzzzZ
    Offline

    DimazzzzZ New Member

    Joined:
    Feb 14, 2014
    Posts:
    1
    Minecraft User:
    Dimas_194
    Please help me to do this query protect doors , am I doing something wrong . I apologize for my bad English .
    Here's the script:

    PHP:
    public function tap ($ data) {
                    if ($ 
    data ['target'] -> getID () == 64 ) {
                            $ 
    username = $ data ['player'] -> username;
                            foreach ($ 
    this-> areas as $ name => $ area) {
                                    if (($ 
    data ['player'] -> level-> getName () == $ area ['level']) and ($ area ['dooraccess'] == false) and ($ area ['owner'] ! = $ username) and (! in_array ($ username, $ area ['members'])) and! $ this-> api-> ban-> isOp ($ username)) {
                                            $ 
    = $ data ['target'] -> x;
                                            $ 
    = $ data ['target'] -> y;
                                            $ 
    = $ data ['target'] -> z;
                                            if (($ 
    area ['pos1'] [ ] <= $ and $ <= $ area ['pos2'] [ ]) and ($ area ['pos1'] [ ] <= $ and $ <= $ area ['pos2'] [ ]) and ($ area ['pos1'] [ ] <= $ and $ <= $ area ['pos2'] [ 2] )) {
    if (($ 
    door-> meta 0x04) === 0x04) {
                                                        $ 
    down = $ door-> getSide 0);
                                                        $ 
    level = $ this-> api-> level-> getDefault ();
                                                         if ($ 
    down-> getID () == 64 ) {
                                             $ 
    meta = $ down-> getMetadata () ^ 0x08;
                                              $ 
    level-> setBlock ($ downBlockAPI :: get 64 , $ meta), truefalsetrue);
                                           return 
    true;
                                           }
                                           return 
    false;
                                               }
    data ['player'] -> sendChat (" This door is protected );
                                                    return true;
    Please help me!
    Last edited by a moderator: Feb 14, 2014
  2. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    41
    Minecraft User:
    ZexyZek
    Hello, My namis Joy Islam,

    To fix it(maybe) I think You should not add space:
    Code:
    $ <variable>
    Should be:
    Code:
    $<variable>
    Maybe wies can explain better,

    Thank you,
    Joy Islam
    LDX, PEMapModder, wies and 1 other person like this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    There is an error message if it crashes.
  4. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    41
    Minecraft User:
    ZexyZek
    oh yeah:
    PHP:
    $data["player"]->sendChat(" This door is protected. ");

    You for got the "
  5. XScripter0
    Offline

    XScripter0 New Member

    Joined:
    Mar 4, 2014
    Posts:
    9
    Lo terminaste?
    Did you finish it?

Share This Page

Advertisement