Jump to content
Mumbles

@go command

Recommended Posts

 

Got it, thank you very much Mumbles! ~

 

Can you please confirm (via in-game test) that nowarpto prevents this version of @go from warping to a map flagged with nowarpto, and that nowarp prevents warping from a map flagged with nowarp?

 

I am unable to test any in-game behaviours at this time.

 

Actually this nowarpto mapflag is designed for @warp command and not @go since you only have limited maps available for @go and you can simply remove the map if you don't want to allow people from warping to that town. 

Edited by Kong

Share this post


Link to post
Share on other sites

Actually this nowarpto mapflag is designed for @warp command and not @go since you only have limited maps available for @go and you can simply remove the map if you don't want to allow people from warping to that town. 

 

Edit:

 

I have another problem though, the script does not bypass the nowarp mapflag even if your GM level is high.

 

So the documentation for nowarpto is correct, then; lost track of what the original issue was for a sec lol.

 

 

In your last reply, you mentioned replacing mf_nowarp with mf_nowarpto:

} else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) {

 

However, the intent of this line is to prevent warping if the player's Group ID isn't high enough OR if the destination has a nowarp flag, regardless of Group ID. You can bypass this for GMs by changing the expression a little (I'm sure there's a prettier way to do it, but I'm not feeling up to it):

} else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp) && getgroupid() < getarg(4)) {

 

 

In regard to your original inquiry, the behaviour of nowarp is to prevent the use of @go to a destination; to prevent the use of @go from a map flagged with nowarp (despite this not being the intent of the nowarp flag), you can still prevent warping by adding an expression similar to my original suggestion:

		} else if (getmapflag(strcharinfo(3), mf_nowarp)) {			message strcharinfo(0), "You are not authorised to warp from this map.";

If you would like to prevent warping from specific maps, I would recommend moving forward with the filter/blacklist route — hell, you could even prevent both nowarp-flagged and specific maps from being warped to if you wanted to.

Share this post


Link to post
Share on other sites

 

Actually this nowarpto mapflag is designed for @warp command and not @go since you only have limited maps available for @go and you can simply remove the map if you don't want to allow people from warping to that town. 

 

Edit:

 

I have another problem though, the script does not bypass the nowarp mapflag even if your GM level is high.

 

So the documentation for nowarpto is correct, then; lost track of what the original issue was for a sec lol.

 

 

In your last reply, you mentioned replacing mf_nowarp with mf_nowarpto:

} else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) {

 

However, the intent of this line is to prevent warping if the player's Group ID isn't high enough OR if the destination has a nowarp flag, regardless of Group ID. You can bypass this for GMs by changing the expression a little (I'm sure there's a prettier way to do it, but I'm not feeling up to it):

} else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp) && getgroupid() < getarg(4)) {

 

 

In regard to your original inquiry, the behaviour of nowarp is to prevent the use of @go to a destination; to prevent the use of @go from a map flagged with nowarp (despite this not being the intent of the nowarp flag), you can still prevent warping by adding an expression similar to my original suggestion:

		} else if (getmapflag(strcharinfo(3), mf_nowarp)) {			message strcharinfo(0), "You are not authorised to warp from this map.";

If you would like to prevent warping from specific maps, I would recommend moving forward with the filter/blacklist route — hell, you could even prevent both nowarp-flagged and specific maps from being warped to if you wanted to.

i tried it but still any gm lvl cant .@go 0 on castles

Share this post


Link to post
Share on other sites

I want to know if I must remove @go command from src or this will replace the current functionality that @go does in src...

Share this post


Link to post
Share on other sites

I want to know if I must remove @go command from src or this will replace the current functionality that @go does in src...

 

This code might be deprecated. If it does still work, it should overwrite the existing functionality of @go. When this was written, you did not need to make any src changes, as bindatcmd binded @go to the specified label within the script.

Share this post


Link to post
Share on other sites

I created the code for glast_01

 

 

        } else if (alias("36", "glast")) {
            go("glast", 370, 304, 0, 0, .cost);

 

        } else {
            message strcharinfo(0), "36: Glast";
            message strcharinfo(0), "@go failed.";
        }
        
        end;

 

 

 

But seems not work ? I replaced the @go command on src\map\atcommand 

Edited by Fred

Share this post


Link to post
Share on other sites
2 hours ago, Fred said:

But seems not work ? I replaced the @go command on src\map\atcommand 

 

Well...this was your first mistake. This is a script-based atcommand utility; it should be loaded as a custom .txt script. Copy the original file I provided and add its location to npc/scripts_custom.conf; doing this will override the src-based atcommand when your server initializes.

 

 

2 hours ago, Fred said:

I created the code for glast_01

 

 

        } else if (alias("36", "glast")) {
            go("glast", 370, 304, 0, 0, .cost);

 

        } else {
            message strcharinfo(0), "36: Glast";
            message strcharinfo(0), "@go failed.";
        }
        
        end;

 

 

 

I think you might have misunderstood the way the script functions. Aliases included in the alias() function serve to allow a player to type multiple different variants of a phrase to arrive at the same location.

 

An example in your case:

alias("36", "glast", "gh")

...would allow the player to type:

@go "36"
@go "glast"
@go "gh"

...and still arrive at the same map and coordinates that you set for that alias.

 

You seem to have added the alias name in the go() function instead of the map name. The correct way to add an @go point for glast_01 would be to include the map_name in the go() function. Try this:

go("glast_01", 370, 304, 0, 0, .cost);

 

 

Hope this resolves your issue. Please note that I wrote this script-based atcommand utility several years ago; I have not kept up with Hercules's progress, so this information may be entirely deprecated. However, if you are running a version of Hercules where this script was still compatible, my corrections should suffice.

 

Good luck!

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.