Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Formatting and adding MySQL cache'd values wont work properly

$
0
0
Basically, what I'm trying to do is make the dialog show as:
Quote:

TEXT AS TABHEADER
35
Michael
Griffin
Alive
ID
Firstname
Surname
Status

But it's only providing me with the SQLID, but nothing else.. Here's my current callback code;
PHP Code:

    forward public OnPlayerLoadCharacters(playerid);
    public 
OnPlayerLoadCharacters(playerid) {
        new 
dialog[524];
        
format(dialog524"{A6856A}Please select your character to spawn");
        if(
cache_num_rows()) {
            for(new 
id 0id cache_num_rows(); id++) {
                new 
sqlidstring[144], firstname[MAX_PLAYER_NAME], surname[MAX_PLAYER_NAME], status;
                
cache_get_value_name_int(id"id"sqlid);
                
cache_get_value_name(id"firstname"firstname);
                
cache_get_value_name(id"surname"surname);
                
cache_get_value_name_int(id"status"status);
                
format(string144"\n%i\t%s\t%s\t%s"sqlidfirstnamesurnameCharStatus[status]);
                
strcat(dialogstring);
            }
            if(
cache_num_rows() < 6)
                
strcat(dialog"\n \n{A1724C}Create a new character");
        }
        else
            
strcat(dialog"\n{A1724C}Create a new character");
        
ShowPlayerDialog(playeridDIALOG_CHARACTERSDIALOG_STYLE_TABLIST_HEADERSDIALOG_TITLEdialog"Select""Cancel");
    } 

What am I doing wrong here?





Viewing all articles
Browse latest Browse all 18226

Trending Articles