SA-MP Forums Archive
Get Duel ID - 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: Get Duel ID (/showthread.php?tid=570702)



Get Duel ID - AlexBlack - 12.04.2015

Hi, it's me again , i have a small problem , i need to get the DuelID from MAX_PLAYERS, i mean for exemple : i'am the leader of the duel and i have type /changemap i will get a dialog of list of too many maps , when i'am choice one of this maps it will put me in the map and put all peoples that is in my duel in this map check my code :

PHP код:
        case DIALOG_DUEL_CHANGEMAP:
        {
            if(
response)
            {
                if(
listitem == 0)
                {
                    for(new 
i=0i<MAX_PLAYERSi++)
                    {
                        if(
pInfo[i][InDuel] == THIS IS WHAT I NEED)
                        {
                               
SetPlayerPos(i298.507934,-141.647048,1004.054748);
                            
Duel[pInfo[i][InDuel]][DuelMap] = 1;
                            
SetPlayerInterior(i7);
                        }
                    }
                }
                if(
listitem == 1)
                {
                    for(new 
i=0i<MAX_PLAYERSi++)
                    {
                        if(
pInfo[i][InDuel] == THIS IS WHAT I NEED)
                        {
                               new 
rand random(sizeof(RandomSpawn));
                               
SetPlayerPos(iRandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
                               
SetPlayerInterior(i15);
                               
Duel[pInfo[i][InDuel]][DuelMap] = 2;
                        }
                    }
                }
            } 
this is my enum

PHP код:
enum DuelInfo
{
    
DuelID,
    
LeaderID,
    
DuelExiste,
    
DuelMap,
    
DuelName[32],
    
DuelLeader[32],
    
DuelMembers,
    
DuelVW
}
new 
Duel[MAX_DUELS][DuelInfo];
new 
Total_Duels_Created
PHP код:
enum playerinfo
{
    
pUsername[24],
    
pPassword[64],
    
pIP[16],
    
pMoney,
    
pAdminLevel,
    
pVipLevel,
    
pKills,
    
pDeaths,
    
pLogged,
    
pClan,
    
pMuted,
    
pRang,
    
pScore,
    
pExp,
    
pWanted,
    
InDuel
}; 
Thank for advancing.


Re: Get Duel ID - Jefff - 13.04.2015

pawn Код:
if(pInfo[i][InDuel] == pInfo[playerid][InDuel])
??