Destroy Text & Pickup -
Abreezy - 24.01.2012
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:
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
:
Re: Destroy Text & Pickup -
Abreezy - 24.01.2012
This is extremely annoying, I've kept trying to fix it, no change sadly.
Re: Destroy Text & Pickup -
Snowman12 - 24.01.2012
DestroyDynamicPickup? Destroy3dtextlabel?
Re: Destroy Text & Pickup -
Abreezy - 24.01.2012
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..
Re: Destroy Text & Pickup -
Snowman12 - 24.01.2012
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
Re: Destroy Text & Pickup -
Abreezy - 24.01.2012
Just tested, It stays there until a restart.
Re: Destroy Text & Pickup -
Snowman12 - 24.01.2012
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?
Re: Destroy Text & Pickup -
Abreezy - 24.01.2012
Negative, Will test now.
Re: Destroy Text & Pickup -
AndreT - 24.01.2012
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.
Re: Destroy Text & Pickup -
Abreezy - 24.01.2012
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.