Jump to content
  • 0

Guild ID check for all party members


gleynn

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  63
  • Reputation:   2
  • Joined:  08/10/12
  • Last Seen:  

Hi,

Can someone please show me a sample script that checks if all party members are in the same guild with the party leader. Thanks :)

 

Edit: only party leader can talk to the npc, and it checks if all of his party members are in the same guild with his.

Edited by gleynn
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

1 hour ago, gleynn said:

Thanks Anacondaqq and apologies for the confusion, im not clear with my request, but im looking for an npc that only talks to a party leader.

prontera,156,180,5	script	PartyChecker	89,{
	
if(getpartyleader(getcharid(1),2) == getcharid(0))
{
	if(select("Check party","Cancel") != 1)
		close;

	.@main_guild = getcharid(2);
	getpartymembers(getcharid(1),2);
	for(.@i = 0; .@i < $@partymembercount; .@i++)
	{
		if(getcharid(2,$@partymembercid[.@i] != .@main_guild) {
			mes "Not all members of the party in the same guild. Break";
			dispbottom strcharinfo(0,$@partymembercid[.@i]) + " out of the guild";
			break;
		}
	}
}

}

I did not test that code, and very sleepy. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

prontera,156,180,5	script	brobrobro	89,{

if(!getcharid(1) || !getcharid(2)) {
	mes "You don't have party or guild";
	close;
}

if(getpartyleader(getcharid(1,2)) == getcharid(0)) {
	dispbottom "You're party leader";
	.party_leader = getcharid(0);
}

if(.party_leader) {
	if(getcharid(2) == getcharid(2,.party_leader))
		dispbottom "You're in the same guild with "+ rid2name(.party_leader);
	else
		dispbottom "You're outside of the guild of the your party leader";
} else {
	dispbottom "Sorry, but there is no party leader yet. Try later.";
}

end;

}

something very stupid like that. Not tested. How is it work? Everyone should talk to the NPC

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  63
  • Reputation:   2
  • Joined:  08/10/12
  • Last Seen:  

6 minutes ago, Anacondaqq said:

prontera,156,180,5	script	brobrobro	89,{

if(!getcharid(1) || !getcharid(2)) {
	mes "You don't have party or guild";
	close;
}

if(getpartyleader(getcharid(1,2)) == getcharid(0)) {
	dispbottom "You're party leader";
	.party_leader = getcharid(0);
}

if(.party_leader) {
	if(getcharid(2) == getcharid(2,.party_leader))
		dispbottom "You're in the same guild with "+ rid2name(.party_leader);
	else
		dispbottom "You're outside of the guild of the your party leader";
} else {
	dispbottom "Sorry, but there is no party leader yet. Try later.";
}

end;

}

something very stupid like that. Not tested. How is it work? Everyone should talk to the NPC

Thanks Anacondaqq and apologies for the confusion, im not clear with my request, but im looking for an npc that only talks to a party leader.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  63
  • Reputation:   2
  • Joined:  08/10/12
  • Last Seen:  

I think it should be

 

getpartymembers(getcharid(1),1);

since you are using character id from the rest of the script. Thank you so much Anacondaqq! :D

Problem Solved!

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