SA-MP Forums Archive
I need Duel system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I need Duel system (/showthread.php?tid=263979)



Can be deleted - liinor - 24.06.2011

Can be deleted


Re: I need Duel system - Stigg - 24.06.2011

Found this with a little SEARCH:

http://forum.sa-mp.com/showthread.ph...ht=Duel+system

Should help you get started.


Can be deleted - liinor - 24.06.2011

Can be deleted


Re: I need Duel system - Jay. - 24.06.2011

Quote:
Originally Posted by liinor
Посмотреть сообщение
Thats /duel id
He said "To help you get started" why do you think people are gonna script you a full code? -.-


Re: I need Duel system - Sascha - 24.06.2011

Quote:
Originally Posted by Funtime
Посмотреть сообщение
He said "To help you get started" why do you think people are gonna script you a full code? -.-
well they actually will... if you give them money, hehe.


Re: I need Duel system - liinor - 24.06.2011

I didnt saw that text under link.


Re: I need Duel system - liinor - 24.06.2011

,,,,


Can be deleted - liinor - 25.06.2011

Can be deleted


Re: I need Duel system - [HiC]TheKiller - 25.06.2011

Here is a example for just one arena

pawn Код:
new DualStarted;
new DualJoin;
new Dualers[2];

public OnGameModeInit()
{
    Dualers[0] = -1;
    Dualers[1] = -1;
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/dual", cmdtext, true))
    {
        if(DualStarted == 1) return SendClientMessage(playerid, 0xFF0000AA, "There is already a dual running!");
        if(DualJoin == 0)
        {
                    SendClientMessageToAll(0x1229FAFF, "The Dual arena has been started!");
                    SetPlayerPos(playerid, /*XPOS*/, /*YPOS*/, /*ZPOS*/);
                    GivePlayerWeapon(playerid, /*WeaponID*/, /*Amo*/);
                    Dualers[0] = playerid;
                    DualJoin = 1;
                    return 1;
        }
        if(DualJoin == 1)
        {
                    SendClientMessageToAll(0x1229FAFF, "The Dual has been started!");
                    SetPlayerPos(playerid, /*XPOS*/, /*YPOS*/, /*ZPOS*/);
                    GivePlayerWeapon(playerid, /*WeaponID*/, /*Amo*/);
                    DualStarted = 1;
                    Dualers[1] = playerid;
        }
        return 1;
    }
    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new str[70];
    if(playerid == Dualers[0])
    {
        DualStarted = 0;
        SpawnPlayer(Dualers[1]);
        new Pname[24];
        GetPlayerName(Dualers[1], Pname, sizeof(Pname));
        format(str, sizeof(str), "%s has won the dual!", Pname);
        SendClientMessageToAll(0x1229FAFF, str);
        Dualers[0] = -1;
        Dualers[1] = -1;
    }
    if(playerid == Dualers[1])
    {
        DualStarted = 0;
        SpawnPlayer(Dualers[0]);
        new Pname[24];
        GetPlayerName(Dualers[0], Pname, sizeof(Pname));
        format(str, sizeof(str), "%s has won the dual!", Pname);
        SendClientMessageToAll(0x1229FAFF, str);
        Dualers[0] = -1;
        Dualers[1] = -1;
    }
    return 1;
}



Can be deleted - liinor - 12.10.2011

Can be deleted