25.02.2019, 16:00
PHP код:
enum GradeInfo
{
gRank,
gLevel,
gName[32],
Float:gHealth,
Float:gArmor
}
// Here I have Grades and the rank number they belong.
new MafiaGrade[][GradeInfo] =
{
{ -1, -1, "None", 0.0, 0.0}, // Blank row that fixes some variables. (Add new levels below this row)
{ 1, DEFAULT_LEVEL, "Junior Associate", 99.0, 0.0 },
{ 1, 3, "Senior Associate", 99.0, 0.0 },
{ 2, 3, "Newbie Crook", 99.0, 0.0 },
{ 2, 44, "Experienced Crook", 99.0, 0.0 },
{ 3, 22, "Light Gunner", 99.0, 0.0 },
{ 3, 11, "Heavy Gunner", 99.0, 0.0 }
};
// In this function I check if there is any grade for X (TeamRank variable) rank.
// If it's exist, I add it in the dialog list.
for(i = 1; i < sizeof(MafiaGrade); i++)
{
dmsg[0] = EOS;
if(MafiaGrade[i][gRank] != TeamRank[playerid])
{
continue;
}
format(dmsg, sizeof(dmsg), "\n"col_team_mafia"%s \t %d", MafiaGrade[i][gName], MafiaGrade[i][gLevel]);
strcat(string, dmsg);
gcounter++;
}
format(dmsg, sizeof(dmsg), "\n"col_team_mafia"%s \t %d", MafiaGrade[i][gName], MafiaGrade[i][gLevel]);
strcat(string, dmsg);
ShowPlayerDialog(playerid, DIALOG_GRADE_MAFIA, DIALOG_STYLE_TABLIST_HEADERS, "Choose your grade", string, "Select", "Cancel");
if(!gcounter)
{
SendErrorMessage(playerid, "There is no available grades for your current rank (%s).", RankName(playerid, TeamRank[playerid]));
}
else
{
ShowPlayerDialog(playerid, DIALOG_GRADE_MAFIA, DIALOG_STYLE_TABLIST_HEADERS, "Choose your grade", string, "Select", "Cancel");
}
No matter what rank I am, it only gives me those two, what is the problem?