05.04.2019, 19:11
Hey there, so basically I have been working on a 3vs3 duel system, and I have finished everything but there's one thing I'm stuck with.
So, here's how I did for 1 vs 1:
But I have no idea how to do it for 2vs2+, because if I'm dueling 2vs2 with someone as soon as one player kills another the duel is over, I want it to be like so when all the players of a team die, the duel ends. Here's how I define opponents and teammates:
It would be something like this probably:
e_DuelInfo[playerid][E_DUEL_LINEUP] = 1; - 1 vs 1
e_DuelInfo[playerid][E_DUEL_LINEUP] = 2; - 2 vs 2
e_DuelInfo[playerid][E_DUEL_LINEUP] = 3; - 3 vs 3
So, here's how I did for 1 vs 1:
pawn Code:
new inviterid = e_DuelInfo[playerid][E_DUEL_STARTER];
if(e_DuelInfo[inviterid][E_DUEL_LINEUP] == 1) {
format(string, sizeof(string), "[DUEL - 1vs1]: {FFFFFF}%s has won the duel against %s.", GetName(killerid), GetName(playerid));
SpawnUser(playerid);
SpawnUser(killerid);
e_DuelInfo[inviterid][E_DUEL_INVITED] = 0;
e_DuelInfo[inviterid][E_DUEL_ACCEPTED] = 0;
e_DuelInfo[playerid][E_DUEL_INVITED] = 0;
e_DuelInfo[playerid][E_DUEL_ACCEPTED] = 0;
}
It would be something like this probably:
pawn Code:
if(e_DuelInfo[inviterid][E_DUEL_LINEUP] == 2) {
...
}
if(e_DuelInfo[inviterid][E_DUEL_LINEUP] == 3) {
...
}
e_DuelInfo[playerid][E_DUEL_LINEUP] = 2; - 2 vs 2
e_DuelInfo[playerid][E_DUEL_LINEUP] = 3; - 3 vs 3
pawn Code:
E_DUEL_OPPONENT[3],
E_DUEL_TEAMMATE[2],