Jump to content
  • 0

Merging 2 warping scripts


Question

Posted (edited)

Hello rAthena ,

 

ill get to the point of this thread ,

 

i wana merg this party warping script with the official warper in npc/custom/warper.txt

 

to be under Last Warp Option,

 

i've tried many times but it gives me many errors 

 

this is the two scripts i wana merg :

prontera,150,180,4	script	Test	100,{
	deletearray .@aid[0],128;
	deletearray @aid[0],128;
	set @j,0;
	set @select$,"";
	getpartymember getcharid(1),2;
	set .@num,$@partymembercount;
	copyarray .@aid[0],$@partymemberaid[0],.@num;
	set .@num,getarraysize(.@aid);
	
	for(set .@i,0;.@i<.@num;set .@i,.@i+1)
		if(isloggedin(.@aid[.@i]))
		{
			set @aid[@j],.@aid[.@i];
			set @j,@j+1;
			set @select$,@select$+":"+rid2name(.@aid[.@i]);
		}
		
	set @menu,select(@select$)-2;
	
	if(isloggedin(@aid[@menu])) {
		getmapxy(@m$,@x,@y,0,rid2name(@aid[@menu]));
		if( getmapflag(@m$,mf_pvp) || @m$ == "mapname" || @m$ == "mapname" ) {
			mes "You cant warp to his map now.";
		} else {
			warp @m$,@x,@y;
		}
		close;
	}
}
and the official one :
 
Edited by Skorm
Edited for code brackets.

2 answers to this question

Recommended Posts

  • 0
Posted

Hello rAthena ,

 

ill get to the point of this thread ,

 

i wana merg this party warping script with the official warper in npc/custom/warper.txt

 

to be under Last Warp Option,

 

i've tried many times but it gives me many errors 

 

Assuming the above script works well.

menu	"Last Warp ^777777["+lastwarp$+"]^000000",-,
    	getcharid(1)?"Party Warp ^CCCCCC["+getpartyname(getcharid(1))+"]^000000":"",Party,
    	" ~ Towns",Towns,
    	" ~ Fields",Fields,
    	" ~ Dungeons",Dungeons,
    	" ~ Guild Castles",Castles,
    	" ~ Guild Dungeons",Guild_Dungeons,
    	" ~ Instances",Instances,
    	" ~ Special Areas",Special;
		
	if (lastwarp$ == "")
		message strcharinfo(0),"You haven't warped anywhere yet.";
	else
		warp lastwarp$,lastwarpx,lastwarpy;
	end;
		
Party:
	deletearray .@aid[0],128;
	deletearray @aid[0],128;
	set @j,0;
	set @select$,"";
	getpartymember getcharid(1),2;
	set .@num,$@partymembercount;
	copyarray .@aid[0],$@partymemberaid[0],.@num;
	set .@num,getarraysize(.@aid);
	
	for(set .@i,0;.@i<.@num;set .@i,.@i+1)
		if(isloggedin(.@aid[.@i]))
		{
			set @aid[@j],.@aid[.@i];
			set @j,@j+1;
			set @select$,@select$+":"+rid2name(.@aid[.@i]);
		}
		
	set @menu,select(@select$)-2;
	
	if(isloggedin(@aid[@menu])) {
		getmapxy(@m$,@x,@y,0,rid2name(@aid[@menu]));
		if( getmapflag(@m$,mf_pvp) || @m$ == "mapname" || @m$ == "mapname" ) {
			mes "You cant warp to his map now.";
			close;
		} else {
			warp @m$,@x,@y;
		}
	}
	end;

P.S: Please use code brackets next time, tyvm!

  • Upvote 1

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