Jump to content
  • 0

NoWarp Cell?


RumbleRO

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  16
  • Reputation:   1
  • Joined:  09/02/22
  • Last Seen:  

I would like to ask if it is possible or doable to disable warping on certain cell.

 

I have my PvP Cell in the middle of Prontera but I can still use the command @go # and can warp to it prontera # #..

 

Is it possible to disable certain cell. Thanks!

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can add something like this for your command

if (map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_PVP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
	clif_displaymessage(fd, "Not allowed in PVP Area");
	return -1;
}

 

Link to comment
Share on other sites

  • 0

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

You could use bindatcmd to wrap a costum @go around the original and check in this if the player using it is in the PvP Cell and if he is, ignore the call of @go.
If he isn't, you could simply call go with the parameters he used.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  16
  • Reputation:   1
  • Joined:  09/02/22
  • Last Seen:  

2 hours ago, Emistry said:

you can add something like this for your command

if (map_getcell(sd->bl.m, sd->bl.x, sd->bl.y, CELL_PVP) && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
	clif_displaymessage(fd, "Not allowed in PVP Area");
	return -1;
}

 

I can still use @go 0 when inside the pvp cell..

testem.png

Edited by RumbleRO
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

it should be placed before you warp to other place... above the pc_setpos(...)

and your character's group shouldn't have the warp anywhere permission

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  16
  • Reputation:   1
  • Joined:  09/02/22
  • Last Seen:  

13 minutes ago, Emistry said:

it should be placed before you warp to other place... above the pc_setpos(...)

and your character's group shouldn't have the warp anywhere permission

Above here?

 

May I ask what you mean with Character's Group shouldn't have the warp anywhere permission. Thank you!

tes.png

Link to comment
Share on other sites

  • 0

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

-	script	GO_WRAPPER	-1,{
	OnInit:
		.map$ = "prontera";
		.start_x = 150;
		.start_y = 150;
		.end_x = 160;
		.end_y = 160;

		bindatcmd("go", strnpcinfo(3) + "::OnGoWrapper");
		end;

	OnGoWrapper:
		if(getmapxy(.@map$, .@x, .@y) < 0) end;

		if(.map$ == .@map$ && (.@x >= .start_x && .@x <= .end_x) && (.@y >= .start_y && .@y <= .end_y)) {
			dispbottom("You can't use @go in this area.");
			end;
		}

		atcommand("@go " + implode(.@atcmd_parameters$, " "));
		end;
}

 

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  16
  • Reputation:   1
  • Joined:  09/02/22
  • Last Seen:  

3 hours ago, Winterfox said:
-	script	GO_WRAPPER	-1,{
	OnInit:
		.map$ = "prontera";
		.start_x = 150;
		.start_y = 150;
		.end_x = 160;
		.end_y = 160;

		bindatcmd("go", strnpcinfo(3) + "::OnGoWrapper");
		end;

	OnGoWrapper:
		if(getmapxy(.@map$, .@x, .@y) < 0) end;

		if(.map$ == .@map$ && (.@x >= .start_x && .@x <= .end_x) && (.@y >= .start_y && .@y <= .end_y)) {
			dispbottom("You can't use @go in this area.");
			end;
		}

		atcommand("@go " + implode(.@atcmd_parameters$, " "));
		end;
}

 

Hi. I tried this my server Crashes when i use @go outside the xy xy area. 😞

Edited by RumbleRO
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...