Jump to content
  • 0

NoWarp Cell?


Question

Posted

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!

7 answers to this question

Recommended Posts

  • 0
Posted

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

 

  • 0
Posted

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.

  • 0
Posted (edited)
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
  • 0
Posted
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

  • 0
Posted (edited)
-	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
  • 0
Posted (edited)
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

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...