Dialog response always the same?!
#3

I got it what I am doing wrong but don't know to fix it :S
I loop through all grades and check if there is any grade that is made for (for example) rank 3.
If there is such grade(s) I add them to dialog.
PHP код:
        case TEAM_MAFIA:
        {
            for(
1sizeof(MafiaGrade); i++)
            {
                
dmsg[0] = EOS;
                
                if(
MafiaGrade[i][gRank] != TeamRank[playerid])
                {
                    continue;
                }
                
                
format(dmsgsizeof(dmsg), "\n"col_team_mafia"%s \t %d"MafiaGrade[i][gName], MafiaGrade[i][gLevel]);
                
strcat(stringdmsg);
                
gcounter++;
            }
            
            if(!
gcounter)
            {
                
SendErrorMessage(playerid"There is no available grades for your current rank (%s)."RankName(playeridTeamRank[playerid]));
            }
            else
            {
                
ShowPlayerDialog(playeridDIALOG_GRADE_MAFIADIALOG_STYLE_TABLIST_HEADERS"Choose your grade"string"Select""Cancel");        
            }        
        } 
But here is the problem, in OnDialogResponse, I am always checking this:
PHP код:
MafiaGrade[listitem 1][gLevel
Pay attention on MafiaGrade[listitem + 1][gLevel]
As we all know, listitem will be always from 0 and up
In this case since in player's dialog are show grades for rank 3 (Light and Heavy gunner).
But they won't be executed through OnDialogResponse becouse that is listitem = 0, and listitem = 1,
and since I'm checking like this MafiaGrade[listitem + 1][gLevel] if you look in my variable,
it only first two grades will be executed through OnDialogResponse

PHP код:
new MafiaGrade[][GradeInfo] =  

    { -
1, -1"None"0.00.0}, // Blank row that fixes some variables. (Add new levels below this row) 
    
1DEFAULT_LEVEL"Junior Associate"99.00.0 }, // listitem = 0
    
13"Senior Associate"99.00.0 }, // listitem = 1
    
23"Newbie Crook"99.00.0 }, 
    { 
244"Experienced Crook"99.00.0 }, 
    { 
322"Light Gunner"99.00.0 }, 
    { 
311"Heavy Gunner"99.00.0 
}; 
Is there any way to fix this?
Reply


Messages In This Thread
Dialog response always the same?! - by masuzaron - 25.02.2019, 16:00
Re: Dialog response always the same?! - by Pottus - 25.02.2019, 16:23
Re: Dialog response always the same?! - by masuzaron - 25.02.2019, 17:23
Re: Dialog response always the same?! - by Pottus - 25.02.2019, 17:29
Re: Dialog response always the same?! - by masuzaron - 25.02.2019, 18:03
Re: Dialog response always the same?! - by Pottus - 25.02.2019, 18:23
Re: Dialog response always the same?! - by masuzaron - 25.02.2019, 19:53
Re: Dialog response always the same?! - by TheToretto - 25.02.2019, 21:22
Re: Dialog response always the same?! - by masuzaron - 26.02.2019, 11:15

Forum Jump:


Users browsing this thread: 1 Guest(s)