Label problem
#1

So I recently implemented a house system using a filterscript. But the problem is this:
http://prntscr.com/4j89bs

The owner, and the price is not being shown.


Loading Houses:
pawn Код:
public LoadHouses()
{
    new rows, fields;
    cache_get_data(rows, fields, cHandle);
    if(rows)
    {
        for(new i=0; i<=MAX_HOUSES; i++)
        {
            if (i == sizeof (HouseInfo)) break;
            new mHolder[1024];
           
            cache_get_field_content(0, "ID", mHolder, cHandle);
            HouseInfo[i][HouseID] = strval(mHolder);
           
            cache_get_field_content(0, "Owned", mHolder, cHandle);
            HouseInfo[i][HouseOwned] = strval(mHolder);
           
            cache_get_field_content(0, "Locked", mHolder, cHandle);
            HouseInfo[i][HouseLocked] = strval(mHolder);
           
            cache_get_field_content(0, "InteriorID", mHolder, cHandle);
            HouseInfo[i][HouseInteriorID] = strval(mHolder);
           
            cache_get_field_content(0, "World", mHolder, cHandle);
            HouseInfo[i][HouseWorld] = strval(mHolder);
           
            cache_get_field_content(0, "OX", mHolder, cHandle);
            HouseInfo[i][OX] = strval(mHolder);
           
            cache_get_field_content(0, "OY", mHolder, cHandle);
            HouseInfo[i][OY] = strval(mHolder);
           
            cache_get_field_content(0, "OZ", mHolder, cHandle);
            HouseInfo[i][OZ] = strval(mHolder);
           
            cache_get_field_content(0, "IX", mHolder, cHandle);
            HouseInfo[i][IX] = strval(mHolder);
           
            cache_get_field_content(0, "IY", mHolder, cHandle);
            HouseInfo[i][IY] = strval(mHolder);
           
            cache_get_field_content(0, "IZ", mHolder, cHandle);
            HouseInfo[i][IZ] = strval(mHolder);
           
            cache_get_field_content(0, "Owner", mHolder, cHandle);
            HouseInfo[i][HouseOwner] = strval(mHolder);
           
           
            new lString[256];
            if(HouseInfo[i][HouseOwned] == 0)
            {
                format(lString, sizeof(lString), "House ID: %i\nHouse Owned: No\nHouse Owner: None\nHouse Price: $%i", HouseInfo[i][HouseID], HouseInfo[i][HousePrice]);
                HouseInfo[i][HouseLabel] = CreateDynamic3DTextLabel(lString, -1, HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ]+0.5, 20.0);
                HouseInfo[i][HouseIcon] = CreateDynamicMapIcon(HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ], 31, -1);
                HouseInfo[i][EnterPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ], -1, -1, -1, 20.0);
                HouseInfo[i][ExitPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][IX], HouseInfo[i][IY], HouseInfo[i][IZ], -1, -1, -1, 20.0);
            }
            else if(HouseInfo[i][HouseOwned] == 1)
            {
                format(lString, sizeof(lString),"House ID: %i\nHouse Owned: Yes\nHouse Owner: %s\nHouse Price: $%i\nHouse Locked: %s", HouseInfo[i][HouseID], HouseInfo[i][HouseOwner], HouseInfo[i][HousePrice], (HouseInfo[i][HouseLocked] == 1) ? ("Yes") : ("No"));
                HouseInfo[i][HouseLabel] = CreateDynamic3DTextLabel(lString, -1, HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ]+0.5, 20.0);
                HouseInfo[i][HouseIcon] = CreateDynamicMapIcon(HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ], 32, -1);
                HouseInfo[i][EnterPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][OX],HouseInfo[i][OY], HouseInfo[i][OZ], -1, -1, -1, 20.0);
                HouseInfo[i][ExitPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][IX], HouseInfo[i][IY], HouseInfo[i][IZ], -1, -1, -1, 20.0);
            }
        }
        CreatedHouses++;
    }
    printf("[House System] %i houses were retrieved..", CreatedHouses);
    return 1;
}
Reply
#2

Код:
public LoadHouses()
{
    new rows, fields;
    cache_get_data(rows, fields, cHandle);
    if(rows)
    {
        for(new i=0; i<=MAX_HOUSES; i++)
        {
            if (i == sizeof (HouseInfo)) break;
            new mHolder[1024];
           
            cache_get_field_content(0, "ID", mHolder, cHandle);
            HouseInfo[i][HouseID] = strval(mHolder);
           
            cache_get_field_content(0, "Owned", mHolder, cHandle);
            HouseInfo[i][HouseOwned] = strval(mHolder);
           
            cache_get_field_content(0, "Locked", mHolder, cHandle);
            HouseInfo[i][HouseLocked] = strval(mHolder);
           
            cache_get_field_content(0, "InteriorID", mHolder, cHandle);
            HouseInfo[i][HouseInteriorID] = strval(mHolder);
           
            cache_get_field_content(0, "World", mHolder, cHandle);
            HouseInfo[i][HouseWorld] = strval(mHolder);
           
            cache_get_field_content(0, "OX", mHolder, cHandle);
            HouseInfo[i][OX] = strval(mHolder);
           
            cache_get_field_content(0, "OY", mHolder, cHandle);
            HouseInfo[i][OY] = strval(mHolder);
           
            cache_get_field_content(0, "OZ", mHolder, cHandle);
            HouseInfo[i][OZ] = strval(mHolder);
           
            cache_get_field_content(0, "IX", mHolder, cHandle);
            HouseInfo[i][IX] = strval(mHolder);
           
            cache_get_field_content(0, "IY", mHolder, cHandle);
            HouseInfo[i][IY] = strval(mHolder);
           
            cache_get_field_content(0, "IZ", mHolder, cHandle);
            HouseInfo[i][IZ] = strval(mHolder);
   
            cache_get_field_content(0, "Price", mHolder, cHandle); // you did' added HouseInfo[i][HousePrice]
            HouseInfo[i][HousePrice] = strval(mHolder); // Modify this section with row name
           
            cache_get_field_content(0, "Owner", mHolder, cHandle);
            format(HouseInfo[i][HouseOwner], 24, mHolder);
           
           
            new lString[256];
            if(HouseInfo[i][HouseOwned] == 0)
            {
                format(lString, sizeof(lString), "House ID: %i\nHouse Owned: No\nHouse Owner: None\nHouse Price: $%i", HouseInfo[i][HouseID], HouseInfo[i][HousePrice]);
                HouseInfo[i][HouseLabel] = CreateDynamic3DTextLabel(lString, -1, HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ]+0.5, 20.0);
                HouseInfo[i][HouseIcon] = CreateDynamicMapIcon(HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ], 31, -1);
                HouseInfo[i][EnterPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ], -1, -1, -1, 20.0);
                HouseInfo[i][ExitPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][IX], HouseInfo[i][IY], HouseInfo[i][IZ], -1, -1, -1, 20.0);
            }
            else if(HouseInfo[i][HouseOwned] == 1)
            {
                format(lString, sizeof(lString),"House ID: %i\nHouse Owned: Yes\nHouse Owner: %s\nHouse Price: $%d\nHouse Locked: %s", HouseInfo[i][HouseID], HouseInfo[i][HouseOwner], HouseInfo[i][HousePrice], (HouseInfo[i][HouseLocked] == 1) ? ("Yes") : ("No"));
                HouseInfo[i][HouseLabel] = CreateDynamic3DTextLabel(lString, -1, HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ]+0.5, 20.0);
                HouseInfo[i][HouseIcon] = CreateDynamicMapIcon(HouseInfo[i][OX], HouseInfo[i][OY], HouseInfo[i][OZ], 32, -1);
                HouseInfo[i][EnterPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][OX],HouseInfo[i][OY], HouseInfo[i][OZ], -1, -1, -1, 20.0);
                HouseInfo[i][ExitPickup] = CreateDynamicPickup(1273, 23, HouseInfo[i][IX], HouseInfo[i][IY], HouseInfo[i][IZ], -1, -1, -1, 20.0);
            }
        }
        CreatedHouses++;
    }
    printf("[House System] %i houses were retrieved..", CreatedHouses);
    return 1;
}
try this
You did't added fetch data of house price, i added it now edit with your row name
Reply
#3

Thank you so much, I totally forgot about it lol

+Rep
Reply
#4

thx your welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)