03.09.2014, 10:19
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:
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;
}