Destroy Text & Pickup
#1

Hey I've started my dynamic house system, so destroying the 3d text and pickup has become an issue, i have it to destroy and recreate, but it only recreates and doesn't destroy . Heres the code:

Enum part:
pawn Код:
hPickup,
    Text3D:hText
In the create house command:
pawn Код:
HouseInfo[Total_House_Created][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[Total_House_Created][hEntranceX],HouseInfo[Total_House_Created][hEntranceY], HouseInfo[Total_House_Created][hEntranceZ],0);
   
    format(string, sizeof(string), "House: %i \nPrice: $%d \nOwner: The State", Total_House_Created, HouseInfo[Total_House_Created][hPrice]);
    HouseInfo[Total_House_Created][hText] = Create3DTextLabel(string,0xFF8000FF,HouseInfo[Total_House_Created][hEntranceX],HouseInfo[Total_House_Created][hEntranceY], HouseInfo[Total_House_Created][hEntranceZ],20.0,0);
Move house command part:

pawn Код:
DestroyDynamicPickup(HouseInfo[houseid][hPickup]);
    DestroyDynamic3DTextLabel(HouseInfo[houseid][hText]);


format(string, sizeof(string), "House: %i \nPrice: $%d \nOwner: The State", houseid, HouseInfo[houseid][hPrice]);
    HouseInfo[houseid][hText] = Create3DTextLabel(string,0xFF8000FF,HouseInfo[houseid][hEntranceX],HouseInfo[houseid][hEntranceY], HouseInfo[houseid][hEntranceZ],20.0,0);
    HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEntranceX],HouseInfo[houseid][hEntranceY], HouseInfo[houseid][hEntranceZ],0);

Thanks in advance for any support. Here's an image to show what I'm talking about:
Reply
#2

This is extremely annoying, I've kept trying to fix it, no change sadly.
Reply
#3

DestroyDynamicPickup? Destroy3dtextlabel?
Reply
#4

I'm guessing you didn't read my code, At All. I have Destroy for both of them, which is why I made this topic due to it not working..
Reply
#5

Yeah I see what you mean, try leaving the area and coming back does it make any difference? I ask this because some times it takes a little while for it to update
Reply
#6

Just tested, It stays there until a restart.
Reply
#7

pawn Код:
HouseInfo[houseid][hPickup] = DestroyDynamicPickup(HouseInfo[houseid][hPickup]);
    HouseInfo[houseid][hText] = DestroyDynamic3DTextLabel(HouseInfo[houseid][hText]);
    format(string, sizeof(string), "House: %i \nPrice: $%d \nOwner: The State", houseid, HouseInfo[houseid][hPrice]);
    HouseInfo[houseid][hText] = Create3DTextLabel(string,0xFF8000FF,HouseInfo[houseid][hEntranceX],HouseInfo[houseid][hEntranceY], HouseInfo[houseid][hEntranceZ],20.0,0);
    HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEntranceX],HouseInfo[houseid][hEntranceY], HouseInfo[houseid][hEntranceZ],0);
Tried that?
Reply
#8

Negative, Will test now.
Reply
#9

Instead of destroying and re-creating, you could just use Streamer_SetFloatData for example to modify the label's information. I found this a better solution than destroying and recreation.
Reply
#10

Quote:
Originally Posted by Snowman12
Посмотреть сообщение
pawn Код:
HouseInfo[houseid][hPickup] = DestroyDynamicPickup(HouseInfo[houseid][hPickup]);
    HouseInfo[houseid][hText] = DestroyDynamic3DTextLabel(HouseInfo[houseid][hText]);
    format(string, sizeof(string), "House: %i \nPrice: $%d \nOwner: The State", houseid, HouseInfo[houseid][hPrice]);
    HouseInfo[houseid][hText] = Create3DTextLabel(string,0xFF8000FF,HouseInfo[houseid][hEntranceX],HouseInfo[houseid][hEntranceY], HouseInfo[houseid][hEntranceZ],20.0,0);
    HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEntranceX],HouseInfo[houseid][hEntranceY], HouseInfo[houseid][hEntranceZ],0);
Tried that?
The destroy 3d text gives tag mismatch and I can't figure out why.

Quote:
Originally Posted by AndreT
Посмотреть сообщение
Instead of destroying and re-creating, you could just use Streamer_SetFloatData for example to modify the label's information. I found this a better solution than destroying and recreation.
Mind explaining or showing how this works, haven't heard of it.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)