[HELP] Public Enemy Housinfo 3dtext
#1

Hello, i was wondering how to make my houseinfo to 3dtext.
I already got this, but when i buy, it won't go away:

Код:
public UpdatePlayerInfo()
{
	for(new i=0; i<MAX_SLOTS; i++)
	{
		// House shit:
		for(new h = 0; h <MAX_HOUSES; h++)
		{
			if(PlayerToPoint(2, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
			{
   				if(HouseInfo[h][hOwned] == 1)
				{
				    if(HouseInfo[h][hRentabil] == 0)
         			{
         			    format(house_string, sizeof(house_string), "~w~De eigenaar van dit huis is ~n~%s~n~Level: %d", HouseInfo[h][hOwner], HouseInfo[h][hLevel]);
					   	//format(house_string, sizeof(house_string), "~w~%s~n~Owned by: ~r~%s", HouseInfo[h][hDescription], HouseInfo[h][hOwner]);
						Update3DTextLabelText(,0x2CDBDEFF,house_string);
						return 1;
					}
					else
					{
					    format(house_string, sizeof(house_string), "~w~De eigenaar van dit huis is ~n~%s~n~Level: %d~n~Rent: ~g~$%d ~w~level: %d~n~Typ /rentroom om een kamer te huren.", HouseInfo[h][hOwner], HouseInfo[h][hLevel], HouseInfo[h][hRent], HouseInfo[h][hLevel]);
					    //format(house_string, sizeof(house_string), "~w~%s~n~Owned by: ~r~%s~n~~w~(Rentable for ~g~$%d~w~)", HouseInfo[h][hDescription], HouseInfo[h][hOwner], HouseInfo[h][hRent]);
						Update3DTextLabelText(MAX_HOUSES,0x2CDBDEFF,house_string);
						return 1;
					}
				}
				else
				{
				    format(house_string, sizeof(house_string), "Dit huis is te koop!\nDiscription: %s\nCost: $%d\nLevel: %d\nto buy this house type /buyhouse", HouseInfo[h][hDescription], HouseInfo[h][hValue], HouseInfo[h][hLevel]);
					//format(house_string, sizeof(house_string), "~w~%s~n~For sale, Cost: ~g~$%d~n~~w~Level: %d", HouseInfo[h][hDescription], HouseInfo[h][hValue], HouseInfo[h][hLevel]);
                    Create3DTextLabel(house_string,0x2CDBDEFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
					return 1;
				}
			}
		}
I was hoping you guys could help me! ^^,
Feel free to contact me on xfire!: jeroenhulshof

- JeroenX
Reply
#2

Some help would be appreciated.
Reply
#3

Hi,

Could you elaborate further on what the issue is? You said when you buy it won't go away, so you purchase the house and the text doesn't change?

If so it may be something to do with these lines:
pawn Код:
Update3DTextLabelText(,0x2CDBDEFF,house_string);
pawn Код:
Update3DTextLabelText(MAX_HOUSES,0x2CDBDEFF,house_string);
If you check the syntax for the Update3DTextLabelText function, you will see that the function requires the ID of the text label in order to process it. MAX_HOUSES will most probably not effect anything, and the first function should actually throw an error during compilation.

You can check the syntax here: https://sampwiki.blast.hk/wiki/Update3DTextLabelText

Cheers,

TJ
Reply
#4

Hello, Thanks for your reaction. but.

Код:
	for(new i=0; i<MAX_SLOTS; i++)
	{
		// House shit:
		for(new h = 0; h <MAX_HOUSES; h++)
		{
			if(PlayerToPoint(2, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
			{
   				if(HouseInfo[h][hOwned] == 1)
				{
				    if(HouseInfo[h][hRentabil] == 0)
         			{
         			    format(house_string, sizeof(house_string), "~w~De eigenaar van dit huis is ~n~%s~n~Level: %d", HouseInfo[h][hOwner], HouseInfo[h][hLevel]);
					   	//format(house_string, sizeof(house_string), "~w~%s~n~Owned by: ~r~%s", HouseInfo[h][hDescription], HouseInfo[h][hOwner]);
    					Update3DTextLabelText(MAX_HOUSES,0x2CDBDEFF,house_string);
						return 1;
					}
					else
					{
					    format(house_string, sizeof(house_string), "~w~De eigenaar van dit huis is ~n~%s~n~Level: %d~n~Rent: ~g~$%d ~w~level: %d~n~Typ /rentroom om een kamer te huren.", HouseInfo[h][hOwner], HouseInfo[h][hLevel], HouseInfo[h][hRent], HouseInfo[h][hLevel]);
					    //format(house_string, sizeof(house_string), "~w~%s~n~Owned by: ~r~%s~n~~w~(Rentable for ~g~$%d~w~)", HouseInfo[h][hDescription], HouseInfo[h][hOwner], HouseInfo[h][hRent]);
         				Update3DTextLabelText(MAX_HOUSES,0x2CDBDEFF,house_string);
						return 1;
					}
				}
				else
				{
				    format(house_string, sizeof(house_string), "Dit huis is te koop!\nDiscription: %s\nCost: $%d\nLevel: %d\nto buy this house type /buyhouse", HouseInfo[h][hDescription], HouseInfo[h][hValue], HouseInfo[h][hLevel]);
					//format(house_string, sizeof(house_string), "~w~%s~n~For sale, Cost: ~g~$%d~n~~w~Level: %d", HouseInfo[h][hDescription], HouseInfo[h][hValue], HouseInfo[h][hLevel]);
                    Houselabel = Create3DTextLabel(house_string,0x2CDBDEFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
					return 1;
				}
			}
		}
When i do this, i will get warnings:

Код:
C:\Users\jeroen hulshof\Desktop\Secondlife-RPG Dutch version\gamemodes\CLRPG.pwn(13370) : warning 213: tag mismatch
C:\Users\jeroen hulshof\Desktop\Secondlife-RPG Dutch version\gamemodes\CLRPG.pwn(13377) : warning 213: tag mismatch
Reply
#5

Hi Again,

Indeed using MAX_HOUSES as the 3D text-draw id is invalid. You need to use Houselabel. That is where the ID is stored by the looks of it...

For instance:

pawn Код:
Houselabel = Create3DTextLabel(house_string,0x2CDBDEFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
The variable "Houselabel" contains the ID you must use in the function instead of MAX_HOUSES

Cheers,

TJ
Reply
#6

hello! Thanks for your quick reaction! =] But,

When i enter a house icon, i get the info:



That is correct, but when i buy the house, i will get this:



And when i reconnect the server, i see nothing.
This is my script code:

Код:
public UpdatePlayerInfo()
{
	for(new i=0; i<MAX_SLOTS; i++)
	{
		// House shit:
		for(new h = 0; h <MAX_HOUSES; h++)
		{
			if(PlayerToPoint(2, i, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
			{
   				if(HouseInfo[h][hOwned] == 1)
				{
				    if(HouseInfo[h][hRentabil] == 0)
         			{
         			    format(house_string, sizeof(house_string), "~w~De eigenaar van dit huis is ~n~%s~n~Level: %d", HouseInfo[h][hOwner], HouseInfo[h][hLevel]);
					   	//format(house_string, sizeof(house_string), "~w~%s~n~Owned by: ~r~%s", HouseInfo[h][hDescription], HouseInfo[h][hOwner]);
    					Update3DTextLabelText(Houselabel,0x2CDBDEFF,house_string);
						return 1;
					}
					else
					{
					    format(house_string, sizeof(house_string), "~w~De eigenaar van dit huis is ~n~%s~n~Level: %d~n~Rent: ~g~$%d ~w~level: %d~n~Typ /rentroom om een kamer te huren.", HouseInfo[h][hOwner], HouseInfo[h][hLevel], HouseInfo[h][hRent], HouseInfo[h][hLevel]);
					    //format(house_string, sizeof(house_string), "~w~%s~n~Owned by: ~r~%s~n~~w~(Rentable for ~g~$%d~w~)", HouseInfo[h][hDescription], HouseInfo[h][hOwner], HouseInfo[h][hRent]);
         				Update3DTextLabelText(Houselabel,0x2CDBDEFF,house_string);
						return 1;
					}
				}
				else
				{
				    format(house_string, sizeof(house_string), "Dit huis is te koop!\nDiscription: %s\nCost: $%d\nLevel: %d\nto buy this house type /buyhouse", HouseInfo[h][hDescription], HouseInfo[h][hValue], HouseInfo[h][hLevel]);
					//format(house_string, sizeof(house_string), "~w~%s~n~For sale, Cost: ~g~$%d~n~~w~Level: %d", HouseInfo[h][hDescription], HouseInfo[h][hValue], HouseInfo[h][hLevel]);
     				Houselabel = Create3DTextLabel(house_string,0x2CDBDEFF,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+1,15,0,1);
					return 1;
				}
			}
		}
Reply
#7

Hi Again,

I don't think the 3D text supports inline coloring using the "~" symbols. I think you must use the brace symbols. So for instance to get white you would add "{FFFFFF}" in front of the text rather than "~w~"

And am I right in thinking the entire 3D text label disappears when you re-connect?

Cheers,

TJ
Reply
#8

hey.

it doesn't appear even when i removed the ~m~ etc.
Reply
#9

And yes, the entire 3d text disappear when i reconnect.
Reply
#10

Someone can help me?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)