for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 0)
{
format(string, sizeof(string), "House Price: %d",HouseInfo[h][hValue]);
housesale1 = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
format(string, sizeof(string), "\nLevel: %d",HouseInfo[h][hLevel]);
housesale2 = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
housesale3 = Create3DTextLabel("\n\n\nType /buyhouse to buy this house",0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
AddStaticPickup(1273, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
SetPlayerMapIcon(h,0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],31,COLOR_1RED);
pickups++;
}
if(HouseInfo[h][hOwned] == 1)
{
format(string, sizeof(string), "Owner: %s",HouseInfo[h][hOwner]);
housesold = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
format(string, sizeof(string), "\nRoom Price: %d",HouseInfo[h][hRent]);
housesold2 = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
format(string, sizeof(string), "\n\nLevel: %d",HouseInfo[h][hLevel]);
housesold3 = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
housesold4 = Create3DTextLabel("\n\n\nType /rentroom to rent a room",0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
AddStaticPickup(1239, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
pickups++;
}
}
Delete3DTextLabel(Text3D:housesale1);
Delete3DTextLabel(Text3D:housesale2);
Delete3DTextLabel(Text3D:housesale3);
for(new hs = 0; hs < sizeof(HouseInfo); hs++)
{
format(string, sizeof(string), "Owner: %s",HouseInfo[hs][hOwner]);
housesold = Create3DTextLabel(string,0x006400FF,HouseInfo[hs][hEntrancex], HouseInfo[hs][hEntrancey], HouseInfo[hs][hEntrancez]+1,15,0,1);
format(string, sizeof(string), "\nRoom Price: %d",HouseInfo[hs][hRent]);
housesold2 = Create3DTextLabel(string,0x006400FF,HouseInfo[hs][hEntrancex], HouseInfo[hs][hEntrancey], HouseInfo[hs][hEntrancez]+1,15,0,1);
format(string, sizeof(string), "\n\nLevel: %d",HouseInfo[hs][hLevel]);
housesold3 = Create3DTextLabel(string,0x006400FF,HouseInfo[hs][hEntrancex], HouseInfo[hs][hEntrancey], HouseInfo[hs][hEntrancez]+1,15,0,1);
housesold4 = Create3DTextLabel("\n\n\nType /rentroom to rent a room",0x006400FF,HouseInfo[hs][hEntrancex], HouseInfo[hs][hEntrancey], HouseInfo[hs][hEntrancez]+1,15,0,1);
}
Delete3DTextLabel(Text3D:housesold);
Delete3DTextLabel(Text3D:housesold2);
Delete3DTextLabel(Text3D:housesold3);
Delete3DTextLabel(Text3D:housesold4);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
format(string, sizeof(string), "House Price: %d",HouseInfo[h][hValue]);
housesale1 = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
format(string, sizeof(string), "\nLevel: %d",HouseInfo[h][hLevel]);
housesale2 = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
housesale3 = Create3DTextLabel("\n\n\nType /buyhouse to buy this house",0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
}
#define MAX_HOUSES 100
new housesale1[MAX_HOUSES];
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 0)
{
housesale1[h] = Create3DTextLabel(string,0x006400FF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
format(string, sizeof(string), "\nLevel: %d",HouseInfo[h][hLevel]);
}
}
.
|
Oh my gosh. I`m not to friendly with 3d text label! Thanks to you both, i will try both of the solutions!
|
new Text3D:housesale[4];
housesale[1] = Create3DTextLabel(text[],Color,X,Y,Z,DrawDistance,VirtualWorld,ThroughWalls);
housesale[2] = [...]
Delete3DTextLabel(housesale[1]);
//debug
if(Delete3DTextLabel(housesale[2])) { print("Text label has been deleted!"); } else { print("Oh failed :["); }