SA-MP Forums Archive
How to update a 3d text label correctly? - 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)
+--- Thread: How to update a 3d text label correctly? (/showthread.php?tid=495377)



How to update a 3d text label correctly? - Aerotactics - 17.02.2014

I've learned how to create a 3d text label and thank Y-less/ColeMiner for his help.

My new issue now is that I'm not sure how to create a new 3d text label --or rather update the existing one-- correctly. When I tried to use Update3dTextLabel I always got an argument mismatch. Here's my code:

Код:
if(strcmp(hInfo[houseid][Name],"ForSale",true)==0)
	{
		HousePickup[houseid] = CreatePickup(1273, 23, iconX, iconY, iconZ);//not bought
		format(HPickupForSale,sizeof(HPickupForSale), "[ Owner ]: %s \n[ Price ] %i",hInfo[houseid][Name],hInfo[houseid][Cost]);
        Create3DTextLabel(HPickupForSale, 0x008080FF, iconX, iconY, iconZ, 30.0, 0, 0);
	}
	else
	{
		HousePickup[houseid] = CreatePickup(1272,23, iconX, iconY, iconZ);//bought
		format(HPickupOwned,sizeof(HPickupOwned), "[ Owner ]: %s",hInfo[houseid][Name]);
        Create3DTextLabel(HPickupOwned, 0x008080FF, iconX, iconY, iconZ, 30.0, 0, 0);
	}
Off-topic: Is there a limit as to how many threads one may have in this subforum? I do seem to need help a lot, and I apologize for that and thank everybody for their help in the past.


Re: How to update a 3d text label correctly? - CuervO - 17.02.2014

https://sampwiki.blast.hk/wiki/Create3DTextLabel

You can see in the related functions:

https://sampwiki.blast.hk/wiki/Update3DTextLabelText

As for your off topic: I don't really think so as long as the questions you've got are all different queries.


Re: How to update a 3d text label correctly? - Aerotactics - 17.02.2014

Quote:
Originally Posted by CuervO
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Create3DTextLabel

You can see in the related functions:

https://sampwiki.blast.hk/wiki/Update3DTextLabelText

As for your off topic: I don't really think so as long as the questions you've got are all different queries.
Thanks for the info, I tried using Update3dTextLabelText again and I still get the same errors:

Код:
hInfo[houseid][iconx]=iconX;
	hInfo[houseid][icony]=iconY;
	hInfo[houseid][iconz]=iconZ;
	format(house, sizeof(house), "Houses/houseid%d",houseid);
	format(HPickupText,sizeof(HPickupText), "[ Owner ]: %s \n[ Price ] $%i\n[ Renter ] %s \n[ Rent Price ] $%i an hour",hInfo[houseid][Name],hInfo[houseid][Cost],hInfo[houseid][Renter],hInfo[houseid][Rentcost]);
	Create3DTextLabel(HPickupText, 0xFFCC00, iconX, iconY, iconZ, 30.0, 0, 0);
	if(strcmp(hInfo[houseid][Name],"ForSale",true)==0)
	{
		HousePickup[houseid] = CreatePickup(1273, 23, iconX, iconY, iconZ);//not bought
        Update3DTextLabelText(HPickupText, 0x00CC00FF, "[ Owner ]: %s \n[ Price ] $%i",hInfo[houseid][Name],hInfo[houseid][Cost]);
	}
	else
	{
		HousePickup[houseid] = CreatePickup(1272,23, iconX, iconY, iconZ);//bought
		Update3DTextLabelText(HPickupText, 0x00CC00FF, "[ Owner ]: %s \n[ Price ] $%i",hInfo[houseid][Name],hInfo[houseid][Cost]);
	}



Re: How to update a 3d text label correctly? - CuervO - 17.02.2014

You need to store the ID of the 3D text that is created when creating the Label in a variable, the same way you already do with the HousePickup variable; There's an example in the wiki on how to do that, please do read it.

You get the error/warning because HPickupText is merely the text that was previously saved, the input needs to be numerical, and equals to the ID of the label to update.


Re: How to update a 3d text label correctly? - Aerotactics - 17.02.2014

Quote:
Originally Posted by CuervO
Посмотреть сообщение
You need to store the ID of the 3D text that is created when creating the Label in a variable, the same way you already do with the HousePickup variable; There's an example in the wiki on how to do that, please do read it.

You get the error/warning because HPickupText is merely the text that was previously saved, the input needs to be numerical, and equals to the ID of the label to update.
OMG After a bunch of Trial and Error, I GOT IT! WOOT! Thanks for the help CuervO, even through my ignorance of getting variables confused lol You should get paid for these things