Dynamic List
#1

Hello there SA:MP community:

I have been working on an MDC system, this particular snippet (below) is suppose to be creating a list of any supervisory unit (rank 5+) show on this list; however it is not showing up at all, for whatever reason. I am not familiar with dynamic lists and such, so I was hoping you could help me out. If someone can find my issue and explain it so I do not make the mistake again in future scripts, I will provide reputation graciously.

pawn Код:
case 5:
                {
                    for(new i=0; i < MAX_PLAYERS; i++)
                    {
                        if(pInfo[i][pFactionRank] >= 5 && pInfo[i][pFaction] == 1 && pInfo[i][pFactionDuty] == 1)
                        {
                            switch(pInfo[i][pFactionRank])
                            {
                                case 5: format(memberstring, sizeof(memberstring), "%s\n%s (%s) %s", memberstring, fInfo[i][fRankName5], pInfo[i][pCustomRank], RPName(i));
                                case 6: format(memberstring, sizeof(memberstring), "%s\n%s (%s) %s", memberstring, fInfo[i][fRankName6], pInfo[i][pCustomRank], RPName(i));
                                case 7: format(memberstring, sizeof(memberstring), "%s\n%s (%s) %s", memberstring, fInfo[i][fRankName7], pInfo[i][pCustomRank], RPName(i));
                                case 8: format(memberstring, sizeof(memberstring), "%s\n%s (%s) %s", memberstring, fInfo[i][fRankName8], pInfo[i][pCustomRank], RPName(i));
                                case 9: format(memberstring, sizeof(memberstring), "%s\n%s (%s) %s", memberstring, fInfo[i][fRankName9], pInfo[i][pCustomRank], RPName(i));
                                case 10: format(memberstring, sizeof(memberstring), "%s\n%s (%s) %s", memberstring, fInfo[i][fRankName10], pInfo[i][pCustomRank], RPName(i));
                            }
                            ShowPlayerDialog(playerid, DIALOG_MDC_SUPERVISORS, DIALOG_STYLE_MSGBOX, "Active Supervisors", memberstring, "", "Back");
                        }
                    }
                }
Kind Regards,
Nmader
Reply
#2

You could start with putting ShowPlayerDialog outside of the loop and check if the string is not empty / if there was someone with rank 5 or above
Also you need to put the "Back" in the first button field and leave the second empty (if I am not mistaken)
Reply
#3

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
You could start with putting ShowPlayerDialog outside of the loop and check if the string is not empty / if there was someone with rank 5 or above
Also you need to put the "Back" in the first button field and leave the second empty (if I am not mistaken)
I have tried both things that you suggested; however the dialog is not opening for whatever reason. I placed in a print statement to check if the ShowPlayerDialog function was being executed, and it was. So I am clueless.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)