Basically, what I'm trying to do is make the dialog show as:
But it's only providing me with the SQLID, but nothing else.. Here's my current callback code;
What am I doing wrong here?
Quote:
TEXT AS TABHEADER |
PHP Code:
forward public OnPlayerLoadCharacters(playerid);
public OnPlayerLoadCharacters(playerid) {
new dialog[524];
format(dialog, 524, "{A6856A}Please select your character to spawn");
if(cache_num_rows()) {
for(new id = 0; id < cache_num_rows(); id++) {
new sqlid, string[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(string, 144, "\n%i\t%s\t%s\t%s", sqlid, firstname, surname, CharStatus[status]);
strcat(dialog, string);
}
if(cache_num_rows() < 6)
strcat(dialog, "\n \n{A1724C}Create a new character");
}
else
strcat(dialog, "\n{A1724C}Create a new character");
ShowPlayerDialog(playerid, DIALOG_CHARACTERS, DIALOG_STYLE_TABLIST_HEADERS, DIALOG_TITLE, dialog, "Select", "Cancel");
}