05.06.2018, 18:47
Hi I need to create a dialog list with data drawn from a sql query only that I can not understand how to do with this code shows me only the last result of the query while I need to show them all the code is this:
Sorry for my bad english
PHP код:
forward GetSkinsForPlayer(playerid);
public GetSkinsForPlayer(playerid)
{
new rows, razza, age, fat,aged, sex, dialogo[1024];
razza = 1;
age = pInfo[playerid][pAge];
sex = pInfo[playerid][pSex];
aged = age+5;
fat = 0;
cache_get_row_count(rows);
if(rows)
{
new s_model, s_age, s_razza, s_fat;
for(new i; i<rows; i++)
{
cache_get_value_int(i, "skinModel", s_model);
cache_get_value_int(i, "skinAge", s_age);
cache_get_value_int(i, "skinRazza", s_razza);
cache_get_value_int(i, "skinFat", s_fat);
printf("Skin Model ID: %d - Age: %d - Razza: %d - Fat: %d ",s_model, s_age, s_razza, s_fat);
format(dialogo, sizeof(dialogo), "[%d] Modello Skin: %d - Etа: %d - %d\n",i,s_model, s_age, aged);
}
ShowPlayerDialog(playerid, DIALOG_SKIN_SELECT, DIALOG_STYLE_LIST, "Seleziona Skin", dialogo, "Scegli", "Chiudi");
}
return true;
}