Jump to content
  • 0
Sign in to follow this  
ItsRas

Party warper with map restrictions and online party member display.

Question

Hello everyone,

Can anyone help me with my party warper? I have managed to convert the script from the other emulator to herc but the problem it won't warp you to your party member.

The error I am getting is this

 

image.png.c24fbc9fd5b7288203118c6f0a5a342d.png

 

The script:

prontera,156,182,0	script	Party Warper	4_F_SWORDMAN,{
	.@pid = getcharid(1);
	.@cid = getcharid(0);
	.@name$ = strcharinfo(0);
	if (!.@pid) end;
	getpartymember .@pid, 0;
	getpartymember .@pid, 1;
	getpartymember .@pid, 2;

	for (.@i = 0; .@i < $@partymembercount; .@i++)
		.@menu$ = .@menu$ + (.@name$ != $@partymembername$[.@i] ? $@partymembername$[.@i] : "") + ":";

	.@s = select(.@menu$) - 1;
	.@target$ = $@partymembername$[.@s];
	
	if (isloggedin($@partymemberaid[.@s], $@partymembercid[.@s])) {
		getmapxy .@map$, .@x, .@y, BL_PC, .@target$;
		if (setarray(.restricted_map$, .@map$) != -1)
			message .@name$,"This is a restricted map.";
		else
			warp .@map$, .@x, .@y, .@cid;
	} else 
		message .@name$, .@target$ + " is not online.";
	
	close;

	OnInit:
		setarray .restricted_map$[0], 
		"payon",
		"geffen";
		end;
}

Hope you guys can help me. Thanks in advance.

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
//Edited by Aeromesi
prontera,156,182,0	script	Party Warper	4_F_SWORDMAN,{
	.@pid = getcharid(1);
	.@cid = getcharid(0);
	.@name$ = strcharinfo(0);
	if (!.@pid) end;
	getpartymember .@pid, 0;
	getpartymember .@pid, 1;
	getpartymember .@pid, 2;

	for (.@i = 0; .@i < $@partymembercount; .@i++)
		.@menu$ = .@menu$ + (.@name$ != $@partymembername$[.@i] ? $@partymembername$[.@i] : "") + ":";

	.@s = select(.@menu$) - 1;
	.@target$ = $@partymembername$[.@s];
	
	if (isloggedin($@partymemberaid[.@s], $@partymembercid[.@s])) {
		getmapxy .@map$, .@x, .@y, UNITTYPE_PC, .@target$;
		dispbottom "Player "+.@target$+" is at map "+.@map$+","+.@x+","+.@y+"";
		if ( .@map$ == .restricted_map$[1] 
		|| .@map$ == .restricted_map$[2] 
		|| .@map$ == .restricted_map$[3]) {
			message .@name$,"This is a restricted map.";
}
		else
			warp .@map$, .@x, .@y, .@cid;
	} else 
		message .@name$, .@target$ + " is not online.";
				dispbottom ""+.@map$+" is a restricted map.";
	close;

	OnInit:
		setarray .restricted_map$[1], 
		"payon",
		"geffen",
		"alberta";
		end;
}

I'm also attaching the txt file directly to my post. I offer a quick fix, not the best but it works. When adding a new map, make sure to add this same line but just change the number to the max amount of maps you have.
image.png.6e56cb2b5f8ba01e21279d85c5f7a161.png

If you add a fourth map to the array in OnInit, make sure to copy and paste and add a .restricted_map$[4] to the line

So far it tests payon, geffen, and alberta, worked like a charm.

partywarper.txt

Share this post


Link to post
Share on other sites
  • 0
Just now, ItsRome said:

Brilliant! Thank you so much for your help @Aeromesi. I appreciate it. ❤️

No problem, if you want make sure to // the dispbottoms, those were for me knowing if variable data was correct. I know it's not automatic like your rAthena version, but this just requires a slight edit I mentioned above when adding a new map, not much of a hassle. If you have problems figuring out adding new maps let me know, but I tried to explain it the best I could.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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