prontera,150,150,4 script Party Recruiter 108,{
mes "[Party Recruiter]";
mes "Welcome to the 7v7 Party Recruiter!";
mes "I can help you form a team for 7v7 matches!";
mes "Do you want to join a team or create a new one?";
switch(select("Join a Team","Create a Team","Cancel")) {
case 1: // Join a team
mes "[Party Recruiter]";
mes "Let me find available teams for you.";
callsub CheckAvailableTeams;
close;
case 2: // Create a team
mes "[Party Recruiter]";
mes "Let’s set up a new team!";
if (getpartycount() > 0) {
mes "You are already in a party!";
close;
}
callsub CreateTeam;
close;
case 3: // Cancel
mes "[Party Recruiter]";
mes "Alright, let me know if you need help later!";
close;
}
OnInit:
// Initialize waiting rooms
set .team1_waitingroom, 0;
set .team2_waitingroom, 0;
end;
CheckAvailableTeams:
// Logic to show available teams
if (.team1_waitingroom < 7) {
mes "Team 1 has " + .team1_waitingroom + "/7 players.";
next;
if (select("Join Team 1") == 1) {
if (.team1_waitingroom < 7) {
warp "waitingroom1", 0, 0;
++.team1_waitingroom;
set @team, 1;
end;
} else {
mes "Sorry, Team 1 is full.";
close;
}
}
}
if (.team2_waitingroom < 7) {
mes "Team 2 has " + .team2_waitingroom + "/7 players.";
next;
if (select("Join Team 2") == 1) {
if (.team2_waitingroom < 7) {
warp "waitingroom2", 0, 0;
++.team2_waitingroom;
set @team, 2;
end;
} else {
mes "Sorry, Team 2 is full.";
close;
}
}
}
mes "No available teams at the moment.";
close;
CreateTeam:
mes "Creating a new team requires 7 players.";
mes "Once all 7 players are in the waiting room, the match can start.";
mes "Do you want to create Team 1 or Team 2?";
next;
switch(select("Team 1","Team 2","Cancel")) {
case 1:
if (.team1_waitingroom > 0) {
mes "Team 1 already exists.";
close;
}
mes "Team 1 is now created!";
set .team1_waitingroom, 1; // Include the leader
warp "waitingroom1", 0, 0;
end;
case 2:
if (.team2_waitingroom > 0) {
mes "Team 2 already exists.";
close;
}
mes "Team 2 is now created!";
set .team2_waitingroom, 1; // Include the leader
warp "waitingroom2", 0, 0;
end;
case 3:
mes "Alright, let me know if you change your mind!";
close;
}
}
OnPCLogoutEvent:
// Handle player leaving the waiting room
if (@team == 1) {
--.team1_waitingroom;
} else if (@team == 2) {
--.team2_waitingroom;
}
end;