Jump to content
  • 0

Party job checker


Hofner

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/02/13
  • Last Seen:  

Hello! I'm using eA SVN.

 

Can anyone help me for the script to not allow same job in party?

Edited by Hofner
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1125
  • Reputation:   236
  • Joined:  07/30/12
  • Last Seen:  


getpartymember(getcharid(1),2);

copyarray .@partyids[0],$@partymembercid[0],$@partymembercount;

set .@count, $@partymembercount;

for (set .@a, 0; .@a < .@count; set .@a, .@a + 1) {

attachrid .@partyids[.@a];

set .@jobs[.@a], Class;

// Check Job from other current jobs

for (set .@b, 0; .@b < getarraysize(.@jobs); set .@b, .@b + 1) {

if (Class == .@jobs[.@b]) {

set .@matches, .@matches + 1;

}

}

// Check if this job as too many

if (.@matches > 2) { // Too Many of the Same Job }

// Less than 2, so reset counter for next player

set .@matches, 0;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  05/02/13
  • Last Seen:  

getpartymember(getcharid(1),2);

copyarray .@partyids[0],$@partymembercid[0],$@partymembercount;

set .@count, $@partymembercount;

for (set .@a, 0; .@a < .@count; set .@a, .@a + 1) {
  attachrid .@partyids[.@a];

  set .@jobs[.@a], Class;
  
  // Check Job from other current jobs
  for (set .@b, 0; .@b < getarraysize(.@jobs); set .@b, .@b + 1) {
    if (Class == .@jobs[.@b]) {
      set .@matches, .@matches + 1;
    }
  }

  // Check if this job as too many
  if (.@matches > 2) { // Too Many of the Same Job }

  // Less than 2, so reset counter for next player
  set .@matches, 0;

}

I don't know where i will put that

 

mes "Choose your team to register.";
			switch(select("Team 1 - [" + GetPartyName($@TeamID1) + "] :Team 2 - [" + GetPartyName($@TeamID2) + "]")) 
				{
				case 1:	mes "[  Admin ]";

						if ($@TeamID1==0 || getpartyname($@TeamID1)=="null") 
						{
							getpartymember(getcharid(1)),1;
							getpartymember(getcharid(1)),2;
							copyarray $@partymembercidt1[0],$@partymembercid[0],$@members;
							copyarray $@partymemberaid1[0],$@partymemberaid[0],$@members;
								for (set .@i,0; .@i<$@members; set .@i,.@i+1) {
									if(isloggedin($@partymemberaid1[.@i],$@partymembercidt1[.@i]))  set .@count,.@count+1;
								}
								if(.@count < $@members) {
									mes "You need all your party members to be online to Register";
									close;
								}
								
							set $@TeamID1, getcharid(1);	
							initnpctimer;	
							mes "Your Party is now subscribed, good luck!";	
							mapannounce "quiz_02", "Team 1 : [ " +getpartyname($@TeamID1)+ " ] party has sign up For the Team War!~",0;
							doevent "teamwar::OnSubscriptionTeam";	
							close;	
						} else {
							mes "I'm sorry! Another Team has sign up before you...";	
							close;	
						}
				case 2:	mes "[  Admin Pips  ]";
					if ($@TeamID2==0 || getpartyname($@TeamID2)=="null") 
					{	
						getpartymember(getcharid(1)),1;
						getpartymember(getcharid(1)),2;
						copyarray $@partymembercidt2[0],$@partymembercid[0],$@members;
						copyarray $@partymemberaid2[0],$@partymemberaid[0],$@members;
							for (set .@i,0; .@i<$@members; set .@i,.@i+1) {
								if(isloggedin($@partymemberaid2[.@i],$@partymembercidt2[.@i])) set .@count,.@count+1;
							}
							if(.@count < $@members) {
								mes "You need all your party members to be online to Register";
								close;
							}
						set $@TeamID2, getcharid(1);	
						initnpctimer;	
						mes "Your Party is now subscribed, good luck!";	
						mapannounce "quiz_02", "Team 2 : [ " +getpartyname($@TeamID2)+ " ] party has sign up For the Team War!~",0;
						doevent "teamwar::OnSubscriptionTeam";	
						close;	

Bump!!

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