Jump to content
  • 0

[WTA] How make custom commands script or bindcommand cannot use in certain mapflag


DK77

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  06/30/17
  • Last Seen:  

How make custom commands script or bindcommand cannot use in certain mapflag like inside gvg castle or war castle . For example is like .
 

Quote

-    script    at_mall    -1,{
OnMallWarp:
    warp "prontera",152,252;
    end;
OnInit:
    bindatcmd "Mall", strnpcinfo(0)+"::OnMallWarp";
}

ill try to add getmapflag like this 
 

Quote

    OnMallWarp:
    if(getmapflag(gvg_castle)){
            mes "You cannot use this command inside a War of Emperium castle.";
            close;
        }
    warp "prontera",152,252;

 

, but im having error on getmapflag 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

Hello,

you should read the documentation more carefully, getmapflag takes at least two arguments.

*getmapflag("<map name>",<flag>{,<type>})

So you need to input the map the user is on as the first argument. 
Based on your example, a working solution would be this:

-	script	at_mall	-1,{
  OnMallWarp:
    if(getmapflag(strcharinfo(3), gvg_castle)){
      dispbottom  "You cannot use this command inside a War of Emperium castle.", 0xFF0000;
      end;
    }

    warp "prontera",152,252;
  end;

  OnInit:
      bindatcmd "Mall", strnpcinfo(0)+"::OnMallWarp";
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...