21.06.2016, 03:09
Hello all,
So I am trying to store three different values into a two-dimensional array, the strings are taken from the database and then stored in the array so that the user is then able to see them in a dialog.
What actually happens is when the data is taken from the database, it tries to store in the array but fails.. and it only displays one value out of two but value is displays is "Create Character".
I'm not really sure what is happening here so if you can see, please let us know.
So I am trying to store three different values into a two-dimensional array, the strings are taken from the database and then stored in the array so that the user is then able to see them in a dialog.
Код:
new Temp[4][];
Код:
public OnPlayerCharacterSelection(playerid) { MySQL::getData(rows, fields); for(new i = 0; i < rows; i++) { MySQL::storeString(i, 0, Temp[i][0]); if(strfind(Temp[i][0], "null", true) != -1) strcat((Temp[i][0] = EOS, Temp[i]), "Create Character", 17); } format(str, sizeof(str), "%s\n%s\n%s", Temp[0], Temp[1], Temp[2]); ShowPlayerDialog(playerid, DIALOG_ACCOUNT, DIALOG_STYLE_LIST, ""SVR_NAME" - Account", str, DIALOG_BUTTON_SELECT, DIALOG_BUTTON_EXIT); }
I'm not really sure what is happening here so if you can see, please let us know.