SA-MP Forums Archive
3DTextLabel Deleting problem. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 3DTextLabel Deleting problem. (/showthread.php?tid=159729)



3DTextLabel Deleting problem. - oliverrud - 14.07.2010

I have a problem with deleting the 3DTextLabel's on my house system, the weird part is it's exact the same as my HQ system, the HQ system works but the house one doesn't, anyways:

Okay so at start of server I of course load the House System inside that I create a 3DTextLabel
pawn Код:
House = Create3DTextLabel(string,COLOR_PURPLE,HouseInfo[idx][SpawnX],HouseInfo[idx][SpawnY],HouseInfo[idx][SpawnZ],20.0,0,1);
Now when a player for example buys a house I made a timer for updating the house text:
The timer on /buyhouse
pawn Код:
SetTimer("HouseText",700,false);
Okay heres the HouseText

pawn Код:
public HouseText()
{
    Delete3DTextLabel(House);
    new idx = 0;
    while(idx < totalhouses)
    {
        new string[120];
        if(HouseInfo[idx][Owned] == 1)
        {
            format(string,sizeof(string),"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),"For Sale!\nName: %s\nPrice: %d",HouseInfo[idx][Name],HouseInfo[idx][Price]);
            House = Create3DTextLabel(string,COLOR_PURPLE,HouseInfo[idx][SpawnX],HouseInfo[idx][SpawnY],HouseInfo[idx][SpawnZ],20.0,0,1);
        }
        idx++;
    }
    return 1;
}
Okay so it's like exact the same as the HQ one but doesn't work, however the HQ one works. When I buy a house or sell it it like just creates both of the 3DTextLabel's on the SpawnX,SpawnY,SpawnZ pos.

So I guess it's not deleting the right way.


Re: 3DTextLabel Deleting problem. - oliverrud - 14.07.2010

Edit: I now changed the public ones to functions, example: UpdateHouses(); So I've replaced that with the SetTimer, however I'm still having the problem where it doesn't delete it, it just create both of them there. Even through I do have the Delete3DTextLabel(house);


Re: 3DTextLabel Deleting problem. - oliverrud - 14.07.2010

I hate to bump my own threads too much but this problem, I can't solve it .