13.05.2016, 22:24
'm doing a furniture system , and I want to display a list of furniture that has a home but the array is too large to be displayed.
this is the command I'm doing to display objects that have a home.
the problem is that the array is too big, and I do not see how to optimize to show correctly the list.
pd: sorry for my bad English :P
Код:
#define MAX_FURNITURE (1000) // max objects #define MAX_HOUSE_FURNITURE (20) // max objects per house
PHP код:
CMD:furniture(playerid, params[])
{
static
houseid = -1;
if ((houseid = House_Inside(playerid)) != -1 && House_IsOwner(playerid, houseid))
{
new count;
static
muebles[MAX_HOUSE_FURNITURE];
for(new i = 0,j = MAX_FURNITURE;i <= j;i++)
{
if (count < MAX_HOUSE_FURNITURE && FurnitureData[i][furnitureExists] && FurnitureData[i][furnitureHouse] == houseid)
{
ListedFurniture[playerid][count++] = i;
muebles[i] = FurnitureData[i][furnitureModel];
}
}
if (count) {
ShowModelSelectionMenu(playerid, "Muebles", MODEL_SELECTION_MUEBLES, muebles, sizeof(muebles), -16.0, 0.0, -55.0, 0.9, 1);
}
else SendErrorMessage(playerid, "esta casa no tiene muebles.");
}
else SendErrorMessage(playerid, "no estбs en el interior de tu casa.");
return 1;
}
pd: sorry for my bad English :P