Jump to content
  • 0

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


Question

Posted

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 

1 answer to this question

Recommended Posts

  • 0
Posted

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";
}

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...