MySQL help
#1

Hi, i'am back to script and i'am trying to make a IC email system, when you type /email you got a list of your emails, so this is the script when email loading :

PHP код:
public OnEmailFind(playerid)
{
    new 
emailtitle[50], emailsender[50], string[1024], emailstatus;
    new 
rows cache_num_rows();
    if(
rows)
    {
        new 
loaded;
        for (
loaded 0loaded != rows; ++loaded)
        {
            
cache_get_field_content(loaded"Sender"emailsender50);
            
cache_get_field_content(loaded"Title"emailtitle255);
            
emailstatus cache_get_field_content_int(loaded"Status");
            
pInfo[playerid][pEmailChoice] = rows;
            if(
emailstatus == 1format(stringsizeof(string), "%s "COL_RED" Title : %s - Sender : %s\n"stringemailtitleemailsender);
            else 
format(stringsizeof(string), "%s "COL_WHITE" Title : %s - Sender : %s\n"stringemailtitleemailsender);
        }
        
Dialog_Show(playeridDialogEmailDIALOG_STYLE_TABLISTpInfo[playerid][pICEmail], string"Select""Close");
    }
    else return 
Server(playerid"You don't have any email.");
    return 
1;

The problem is that i want to make the dialog when player choice one of the email (how to check which email have choose it's will show him the text "EmailText") on the dialog list, but i don't have idea to make this, i need a small help, Thx.
Reply
#2

Easiest way is probably to save that cache (in a per-player variable) for later use in OnDialogResponse. Then when player selects something, activate the cache and use listitem to access the correct row and display that information. Then delete the cache.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)