27.08.2010, 13:09
The easiest (but maybe not fastest) way should be to use arrays for Body, Sender etc, so you assign them to some kind of "mail id"
You can use mailcount as index:
Another way would be, to use another query in OnDialogResponse. Do it like with the while() until the mailcount is equal to the listitem param, so you have the mail with the selected id.
You can use mailcount as index:
pawn Код:
new Body[MAX_PLAYERS][MAX_MAILS][128] , Sender[MAX_PLAYERS][MAX_MAILS][24], EmailSubject2[MAX_PLAYERS][MAX_MAILS][64], line[256];
//They would have to be global, unforunally uses lots of ram
[...]
sscanf(line, "p<|>s[24]s[64]s[128]", Sender[playerid][mailcount], EmailSubject2[playerid][mailcount], Body[playerid][mailcount]);
[...]
format(EmailList,sizeof(EmailList),"%s\nSender:%s\tSubject:%s",EmailList,Sender[playerid][mailcount], EmailSubject2[playerid][mailcount]);
//Then in OnDialogResponse use the listitem parameter and the playerid to get the selected mail