How to check party leader

Amalgam

New member
Messages
42
Points
0
Hello,

Can anybody help me. I want a npc to check if party leader is dead.

Like when party leader is dead. the npc will say "Your party leader is dead".

Thank you.

 
try this

Code:
-	script	asdf1234	-1,{end;OnPCDieEvent:	set .@pid,getcharid(1);	if(!.@pid) end;	set .@daid,getcharid(3);	if(getpartyleader(.@pid,1)== .@daid ) {		getpartymember getcharid(1),2;		for(set .@i,0;.@i<$@partymembercount;set .@i,.@i+1) {			if($@partymemberaid[.@i]==.@daid) continue;			if(attachrid($@partymemberaid[.@i])) 				message strcharinfo(0), "Your party leader is dead!";		}	}end;}
 
Last edited by a moderator:
try this

- script asdf1234 -1,{end;OnPCDieEvent: set .@pid,getcharid(1); if(!.@pid) end; set .@daid,getcharid(3); if(getpartyleader(.@pid,1)== .@daid ) { getpartymember getcharid(1),2; for(set .@i,0;.@i<$@partymembercount;set .@i,.@i+1) { if($@partymemberaid[.@i]==.@daid) continue; if(attachrid($@partymemberaid[.@i])) message strcharinfo(0), "Your party leader is dead!"; } }end;}

Hello,

Im trying to add it here. can you help me.

if ( GetPartyLeader(getcharid(1),2) == getcharid(0)) { mes "Sorry, I cant warp you. You are the party leader."; }else if( !isloggedin( .@party_leader_aid,.@party_leader_cid ) ){ mes "Party Leader not online..."; }else if( strcharinfo(3) == .@party_leader_map$ ){ mes "Both of you at same map."; }else if( !Hp ){ mes "Your party leader is dead. I can't warp you there.";

Thank you!

 
try this

- script asdf1234 -1,{end;OnPCDieEvent: set .@pid,getcharid(1); if(!.@pid) end; set .@daid,getcharid(3); if(getpartyleader(.@pid,1)== .@daid ) { getpartymember getcharid(1),2; for(set .@i,0;.@i<$@partymembercount;set .@i,.@i+1) { if($@partymemberaid[.@i]==.@daid) continue; if(attachrid($@partymemberaid[.@i])) message strcharinfo(0), "Your party leader is dead!"; } }end;}

Hello,

Im trying to add it here. can you help me.

if ( GetPartyLeader(getcharid(1),2) == getcharid(0)) { mes "Sorry, I cant warp you. You are the party leader."; }else if( !isloggedin( .@party_leader_aid,.@party_leader_cid ) ){ mes "Party Leader not online..."; }else if( strcharinfo(3) == .@party_leader_map$ ){ mes "Both of you at same map."; }else if( !Hp ){ mes "Your party leader is dead. I can't warp you there.";

Thank you!
try to change this line

}else if( !Hp ){

to

} else if(set(.@tempaid,getcharid(3)) && attachrid(GetPartyLeader(getcharid(1),1)) && !Hp && attachrid(.@tempaid) ) {

 
Last edited by a moderator:
Thank you so much!
default_smile.png


 
Back
Top