Jump to content
  • 0

Help with Party check


Question

Posted (edited)

can anyone help me on this party check.

a leader will talk to the NPC for the whole party get warp to a specific map. the npc requirement will be

> all party members should be in the map of prontera. if some member are not in this map the party leader will get a message that all party members must be in prontera.
> all party members should be online. if some member are not online the party leader will get a message some of your party member are currently offline.
> all party members should have this variable called TICKETMANIAC. if some party member does not have 1 TICKETMANIAC variable, the party leader will get a message some of your party member doesn't have enough TICKETMANIAC.

if all party members including the leader meet the requirements

> all party member will be warp to a specific map let say payon.
> all party member TICKETMANIAC will decrease by 1.

 

Thanks in advance ...

Edited by neXus

5 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, crazyarashi said:

function	party_check	{
	.@map$ = "prontera";
	getpartymember getcharid(1),2;
	getpartymember getcharid(1),2;
	for( .@i = 0; .@i < $@partymembercount; .@i++ ){
		if(attachrid($@partymemberaid[.@i])) {
			if(strcharinfo(3) != .@map$){
			mes "All members is not in prontera.";
			close;
			}
			if(TICKETMANIAC == 1){
				mes "Some of your party members does not have ticket maniac.";
				close;
				}
			if(!isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i])){
				mes "A member is not online.";
				close;
				}
			TICKETMANIAC = 0;
			warp "payon",123,123;		
			end;
			}
		detachrid;
	}
	return;
}

feel free to test this (not sure if it's gonna work no time to test it) :))

Use getvar instead of attachrid

  • 0
Posted
12 hours ago, crazyarashi said:

function	party_check	{
	.@map$ = "prontera";
	getpartymember getcharid(1),2;
	getpartymember getcharid(1),2;
	for( .@i = 0; .@i < $@partymembercount; .@i++ ){
		if(attachrid($@partymemberaid[.@i])) {
			if(strcharinfo(3) != .@map$){
			mes "All members is not in prontera.";
			close;
			}
			if(TICKETMANIAC == 1){
				mes "Some of your party members does not have ticket maniac.";
				close;
				}
			if(!isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i])){
				mes "A member is not online.";
				close;
				}
			TICKETMANIAC = 0;
			warp "payon",123,123;		
			end;
			}
		detachrid;
	}
	return;
}

feel free to test this (not sure if it's gonna work no time to test it) :))

11 hours ago, Secrets said:

Use getvar instead of attachrid

It's working except for one thing.. The function did check the location of all party member however if a member is not in the map of prontera, that player receive the message "All members is not in prontera.". this message should be getting by the party leader only.

  • 0
Posted
function	check	{
	.@pid = getcharid(1);
	if(!.@pid) end;
	if(getpartyleader(.@pid, 2) != getcharid(0)) {
		message strcharinfo(0), "You are not the party leader";
		end;
	}
	getpartymember .@pid,0;
	getpartymember .@pid,1;
	getpartymember .@pid,2;
	
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
			getmapxy(.@map$,.@x,.@y,UNITTYPE_PC, $@partymembername$[.@i]);
			if(.@map$ != "prontera") {
				message strcharinfo(0), "Some members are not in Prontera";
				end;
			}
			if(getvar(TICKETMANIAC, $@partymembercid[.@i]) < 1) {
				message strcharinfo(0), "Some members don't have the ticket";
				end;
			}
			
		} else {
			message strcharinfo(0), "Some members are offline";
			end;
		}
	}
	
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
			set TICKETMANIAC, TICKETMANIAC - 1, $@partymembercid[.@i];
	}
	
	warpparty "morocc",0,0,.@pid;
}

 

  • -1
Posted
function	party_check	{
	.@map$ = "prontera";
	getpartymember getcharid(1),2;
	getpartymember getcharid(1),2;
	for( .@i = 0; .@i < $@partymembercount; .@i++ ){
		if(attachrid($@partymemberaid[.@i])) {
			if(strcharinfo(3) != .@map$){
			mes "All members is not in prontera.";
			close;
			}
			if(TICKETMANIAC == 1){
				mes "Some of your party members does not have ticket maniac.";
				close;
				}
			if(!isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i])){
				mes "A member is not online.";
				close;
				}
			TICKETMANIAC = 0;
			warp "payon",123,123;		
			end;
			}
		detachrid;
	}
	return;
}

feel free to test this (not sure if it's gonna work no time to test it) :))

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