[no beginners]Detecting clicked mail
#1

SOLVED!
removed for idea stealers
Reply
#2

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:

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
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.
Reply
#3

Thanks for your sulotions!
I didn't know that it has a variable! I used the variable and strcmp and got it working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)