Get Duel ID
#1

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.
Reply
#2

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


Forum Jump:


Users browsing this thread: 2 Guest(s)