15.07.2010, 13:26
I've had a problem with my 3DTextLabel's for my house system, for some reason the 3DTextLabel doesn't get deleted when a house is bought and then a new one should be created.
My function are like this:
It's executed every time someone sells or buys a house. As well as on server start on the loading process.
Anyhow, the thing I don't get is that I got a exact same function just with HQInfo for my HQ system and that works perfectly, okay so I've been trying to make it work & been testing some stuff what I got was that it's only the last house in the ids that works fine all the others are bugged, I added houses 0-5 Number 5 works but 0,1,2,3,4 doesn't.
What happens when I buy a house is this: http://h.imagehost.org/view/0659/sa-mp-002
If you notice on the picture there you can see it doesn't get deleted but a new one just gets placed on top of the other one. The last one works all fine and gets deleted.
My function are like this:
pawn Код:
function UpdateHouses()
{
new idx = 0;
Delete3DTextLabel(House);
while(idx < totalhouses)
{
new string[140];
if(HouseInfo[idx][Owned] == 1)
{
format(string,sizeof(string),"House Name: %s",HouseInfo[idx][Name]);
House = Create3DTextLabel(string,COLOR_PURPLE,HouseInfo[idx][SpawnX],HouseInfo[idx][SpawnY],HouseInfo[idx][SpawnZ],20.0,0,1);
}
else if(HouseInfo[idx][Owned] == 0)
{
format(string,sizeof(string),"House For Sale!\nName: %s\nPrice: %d\nInterior: %d",HouseInfo[idx][Name],HouseInfo[idx][Price],HouseInfo[idx][Interior]);
House = Create3DTextLabel(string,COLOR_PURPLE,HouseInfo[idx][SpawnX],HouseInfo[idx][SpawnY],HouseInfo[idx][SpawnZ],20.0,0,1);
}
idx++;
}
return 1;
}
Anyhow, the thing I don't get is that I got a exact same function just with HQInfo for my HQ system and that works perfectly, okay so I've been trying to make it work & been testing some stuff what I got was that it's only the last house in the ids that works fine all the others are bugged, I added houses 0-5 Number 5 works but 0,1,2,3,4 doesn't.
What happens when I buy a house is this: http://h.imagehost.org/view/0659/sa-mp-002
If you notice on the picture there you can see it doesn't get deleted but a new one just gets placed on top of the other one. The last one works all fine and gets deleted.