12.05.2011, 07:38
Allright, i want to do at the houses pickups a 3dtextlabel that shows the owner price level etc.
I did it, it shows allright. But when i do /sellhouse, the old 3dtextlabel doesn`t dissapear. Same at /buyhouse.
I could do that houndred of times so hundred of 3dtextlabels could be created in one single place...
To remember: I did Delete3dTextLabel(nameofthelabel);
Some part of what i scripted:
At buyhouse
At /sellhouse
So, any help would be fine.
I did it, it shows allright. But when i do /sellhouse, the old 3dtextlabel doesn`t dissapear. Same at /buyhouse.
I could do that houndred of times so hundred of 3dtextlabels could be created in one single place...
To remember: I did Delete3dTextLabel(nameofthelabel);
Some part of what i scripted:
Код:
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); }