Dynamic List - 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: Dynamic List (
/showthread.php?tid=485388)
Dynamic List -
nmader - 04.01.2014
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
AW: Dynamic List -
Nero_3D - 04.01.2014
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)
Re: AW: Dynamic List -
nmader - 04.01.2014
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.