Jump to content
  • 0

[solved] Putting arrays into teams


pajodex

Question


  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

Hi,

So, I've managed to do this pseudo-code but now I'm lost without direction, maybe some one can point me to it.

 

OnRegister:
	.Player_Array[getarraysize(.Player_Array)] = getcharid(3);
	donpcevent strnpcinfo(0)+"::OnStart";
	mes "You have successfully joined a queue.";
	close;
	
OnStart:
	if(getarraysize(.Player_Array) < 10) end; // checks if player registered are < 10
	.player_per_team = getarraysize(.Player_Array) / 2;
	for(.@i = 0; .@i<getarraysize(.Player_Array); .@i++) {
		if (getarraysize(.Team1) < .player_per_team)
		{
			.Team1[getarraysize(.Team1)] = .Player_Array[.@i];
			party_create "TEAM1";
			// join party team 1
			
		}
		else if (getarraysize(.Team2) < .player_per_team)
		{
			.Team2[getarraysize(.Team2)] = .Player_Array[.@i];
			party_create "TEAM2";
			// join party team 2
			
		}
	}

So here are my questions: (I put everything here to avoid multiple post but its only related to one another)

  1. Will this set half of the total registered players to team 1 and team 2?
  2. If not, please do show me a pseudocode on how to or at least a free script for me to use as basis. I tried searching but most of Party v Party are outdated already.

Solved: thanks

 

Edited by pajodex
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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