2v2 Duels.
#1

I was thinking of making a 2v2 duel system for my server, but i am a little bit confused... about how would it work, i have made my mind like this:

A - B vs C - D

A will create duel settings (duel weapon, arena etc) and enter 3 ids, where first ID = B, second and third ids will be C & D.

Server will send the request to ID B, to accept the duel, in case he does server will proceed with sending request to ID C & D, in case B does not accept the duel, duel will be canceled.

Now its upto C & D to accept or reject, if both accept, the duel will start otherwise duel canceled.

What do you guys say?
Reply
#2

add a backup plan like inviting E & F also if anyone from the others don't accept it will proceed to e & f. If the others already accept then no need to invite e & f
Reply
#3

All depends on how you want to handle the encounters. Do you want people to choose their team mates or not? The way you described it is a little bit of both, which is crap.

Option 1: Defined Duels
The duel creator specifies 3 IDs that take part in the duel. You can either let him set the teams, or give the players the choice to join Team Red or Blue.

Option 2: Queueing Duels
You let the duel creator open up a duel request and wait for 3 other people to sign up. After the slots are filled, you assign the players randomly to two seperate teams.
Reply
#4

Option 1: with 3 IDs.
Reply
#5

Well then: Let the player type in a command with 3 IDs (/duel 0 4 9). Either specify in what order the IDs should be listed (e.g. /duel <teammate> <opponent1> <opponent2>), or show the creator a dialog with the three players listed as listitems and let him choose his teammate. After that, show a dialog to specify the weapons. If the creators is done with all this, send out a duel request to the other 3 players. If one player declines the request, cancel the duel.
Reply
#6

I like the idea.
Reply
#7

One thing more if some one declines then make the players, who accept, teleport to the duel destination, freeze them and then let the creator choose another player. better than choosing all the players all over again
Reply
#8

Tbh, almost finished, working on something like manyula said, will post code later on.
Reply
#9

I am pretty much confused on a thing, if someone could gimme a hand...

Thing is, i soon realized the duel will have at least 2 rounds (or 3...), and i find that complicated, my plan was:

When 1 player dies, put him in the cage just above the arena (i've already mapped), so he can see the duel.

I am pretty much confused how to handle this thing, the rounds, and how to elaborate the OnPlayerDeath, i hope i explained myself.
Reply
#10

I do not know what might confuse you as it is easy. If you got a variable which registers the death of the player, then it can be easily done. One example is:

PHP Code:
new IsDead[MAX_PLAYERS] = 0;

public 
OnPlayerConnect(playerid)
{
     
IsDead[playerid] = 0;
     return 
1;
}

public 
OnPlayerDeath(playeridkilleridreason)
{
     
IsDead[playerid] = 1;
     return 
1;
}

public 
OnPlayerSpawn(playerid)
{
     if(
IsDead[playerid] == 1)
     {
          
//Make him observe the duel
     
}
     else
     {
          
// spawn him so he may fight
     
}
     return 
1;

And in the function which gets called when the round ends, you should add IsDead[playerid] = 0; so he may be spawned normally the next time he tries to spawn.
Reply
#11

Either i failed to understand you, or you fully failed to understand the problem, anyway, i've done it like this:

PHP код:
IsPlayerDead[playerid] = true;
    new 
str[128], pname[24], pname1[24];
    
GetPlayerName(playeridpnamesizeof(pname));
    
GetPlayerName(GetPartnerID(playerid), pname1sizeof(pname1));
    if(
IsInDuel[playerid] && !IsPlayerDead[GetPartnerID(playerid)]) 
    {
        
IsPlayerDead[playerid] = true
        
SetPlayerPos(playerid, -467.8871,-1804.9890,1762.0316);
        
SendClientMessage(playerid, -1""R"You've died, but your partner is still alive, please wait till they finish!");
        
format(strsizeof(str), ""G"Player %s(%i) (%s(%i)'s partner) died!",pnameplayeridpname1,GetPartnerID(playerid) );
        
SendMessageToDuel(str);
    }    
    if(
IsInDuel[playerid] && IsPlayerDead[GetPartnerID(playerid)] && mData[0][Round] == 0)
    {
        new 
pname2[24], pname3[24], pname4[24], pname5[24];
        
GetPlayerName(mData[0][ids][3], pname224);
        
GetPlayerName(mData[0][ids][0], pname324);
        
GetPlayerName(mData[0][ids][1], pname424);
        
GetPlayerName(mData[0][ids][2], pname524);
        
format(strsizeof(str), ""G"%s(%i) & %s(%i) Won Round 1/2 "R"VS"G" %s(%i) & %s(%i)... next round is now starting!",pname2mData[0][ids][3], pname3mData[0][ids][0], pname4mData[0][ids][1], pname5mData[0][ids][2] );
        
SendClientMessageToAll(-1str);
    
        
SendMessageToDuel(""YE"[ROUND 2]"G"The Duel is now starting...");
        
SetPlayerPos(mData[0][ids][3], -465.8945,-1824.0327,1755.5266), SetPlayerPos(mData[0][ids][0], -465.9754,-1820.6588,1755.5266), SetPlayerPos(mData[0][ids][1], -420.5116,-1820.4299,1755.5266), SetPlayerPos(mData[0][ids][2], -420.3315,-1823.3230,1755.5266);
        
ResetPlayerWeapons(mData[0][ids][3]), ResetPlayerWeapons(mData[0][ids][0]), ResetPlayerWeapons(mData[0][ids][1]), ResetPlayerWeapons(mData[0][ids][2]); 
        
GivePlayerWeapon(mData[0][ids][3], mData[0][weaponID], 999999), GivePlayerWeapon(mData[0][ids][0], mData[0][weaponID], 999999), GivePlayerWeapon(mData[0][ids][1], mData[0][weaponID], 999999), GivePlayerWeapon(mData[0][ids][2], mData[0][weaponID], 999999); 
        
SetPlayerHealth(mData[0][ids][3], 100), SetPlayerHealth(mData[0][ids][0], 100), SetPlayerHealth(mData[0][ids][1], 100), SetPlayerHealth(mData[0][ids][2], 100);
        
SetPlayerArmour(mData[0][ids][3], 100), SetPlayerArmour(mData[0][ids][0], 100), SetPlayerArmour(mData[0][ids][1], 100), SetPlayerArmour(mData[0][ids][2], 100);        
        
TogglePlayerControllable(mData[0][ids][3], 0), TogglePlayerControllable(mData[0][ids][0], 0), TogglePlayerControllable(mData[0][ids][1], 0), TogglePlayerControllable(mData[0][ids][2], 0);
        
mData[0][Round] = 1;
        
Partner[mData[0][ids][3]] = mData[0][ids][0];
        
Partner[mData[0][ids][0]] = mData[0][ids][3];
        
Partner[mData[0][ids][1]] = mData[0][ids][2];
        
Partner[mData[0][ids][2]] = mData[0][ids][1];
        
countdown 5;
        
cdTimer SetTimer("cd"1000true);
    
    }
    return 
1;

Reply
#12

I would appreciate it if you would take this under the Scripting Help board and provide more information about what you're asking and what you're trying to achieve.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)