08.02.2019, 20:20
Good evening, how can I make the dialog below be in multiple lists? I mean I add in a dialog (example: 25 lines in 5 pages), thank you!
OnDialogResponse
OnDialogResponse
PHP код:
if(listitem == 0)
{
new list[2048];
format(list, sizeof(list), ""C_ALB"#\t"C_ALB"Obiect\t"C_ALB"Pret\n");
for(new i; i < sizeof(HouseFurnitures); ++i)
{
format(list, sizeof(list), "%s%d\t%s\t"C_MONE"$%s\n", list, i+1, HouseFurnitures[i][Name], convertNumber(HouseFurnitures[i][Price]));
}
ShowPlayerDialog(playerid, DIALOG_FURNITURE_BUY, DIALOG_STYLE_TABLIST_HEADERS, ""C_DIA"Meniu casa", list, "Buy", "Back");
}
if(listitem == 0)
{
new list[2048];
format(list, sizeof(list), ""C_ALB"#\t"C_ALB"Obiect\t"C_ALB"Pret\n");
for(new i; i < sizeof(HouseFurnitures); ++i)
{
format(list, sizeof(list), "%s%d\t%s\t"C_MONE"$%s\n", list, i+1, HouseFurnitures[i][Name], convertNumber(HouseFurnitures[i][Price]));
}
ShowPlayerDialog(playerid, DIALOG_FURNITURE_BUY, DIALOG_STYLE_TABLIST_HEADERS, ""C_DIA"Meniu casa", list, "Buy", "Back");
}
PHP код:
if(dialogid == DIALOG_FURNITURE_BUY)
{
if(!response) return ShowHouseMenu(playerid);
new id = InHouse[playerid];
if(id == INVALID_HOUSE_ID) return SCM(playerid, 0xE74C3CFF, ""C_SRV"SERVER:"C_TXT" Nu va aflati in casa dvs. personala.");
if(strcmp(HouseData[id][Owner], Player_GetName(playerid))) return SCM(playerid, 0xE74C3CFF, ""C_SRV"SERVER:"C_TXT" Nu esti proprietarul acesti case personale.");
if(HouseData[id][SalePrice] > 0) return SCM(playerid, 0xE74C3CFF, ""C_SRV"SERVER:"C_TXT" Atata timp cat casa dvs. este pusa in vanzare nu puteti folosi aceasta actiune.");
if(HouseFurnitures[listitem][Price] > GetPlayerMoney(playerid)) return SCM(playerid, 0xE74C3CFF, ""C_SRV"SERVER:"C_TXT" Nu ai suficienti bani pentru a utiliza aceasta actiune!");
GivePlayerCash(playerid, -HouseFurnitures[listitem][Price]);
Update(playerid, pCashx);
format(strings, sizeof(strings), "~r~-%s",FormatNumber(HouseFurnitures[listitem][Price]));
GameTextForPlayer(playerid, strings, 5000, 3);
SCM(playerid, 0xFFFFFFFF, ""C_SRV"SERVER:"C_SKI" Pentru a misca camera, apasati tasta "C_ALB"SPACE"C_SKI" iar pentru a misca obiectul, apasa click pe (X,Y,Z).");
SCM(playerid, 0xFFFFFFFF, ""C_SRV"SERVER:"C_SKI" Iar pentru a anula actiunea apasati tasta "C_ALB"ESC"C_SKI", obiectul o sa fie spawnat (in locul initial).");
new Float: x, Float: y, Float: z;
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 3.0);
new objectid = CreateDynamicObject(HouseFurnitures[listitem][ModelID], x, y, z, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
mysql_format(handle, query, sizeof(query), "INSERT INTO housefurnitures SET HouseID=%d, FurnitureID=%d, FurnitureX=%f, FurnitureY=%f, FurnitureZ=%f, FurnitureVW=%d, FurnitureInt=%d", id, listitem, x, y, z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
new Cache: add = mysql_query(handle, query), data[e_furniture];
data[SQLID] = cache_insert_id();
data[HouseID] = id;
data[ArrayID] = listitem;
data[furnitureX] = x;
data[furnitureY] = y;
data[furnitureZ] = z;
data[furnitureRX] = 0.0;
data[furnitureRY] = 0.0;
data[furnitureRZ] = 0.0;
cache_delete(add);
Streamer_SetArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID, data);
EditingFurniture[playerid] = true;
EditDynamicObject(playerid, objectid);
return 1;
}