3DTextLabel doesn't appear everything
#1

Hey, i had a problem with my house system. Here is the code for making rented sytem, but i got little problem, the 3d text just show a part of it (not full)

Code:
CMD:sethousetorent(playerid, params[])
{
	new id, str[256], pname[256], playername[25], tmp2[256], tmp[256];
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	if (areatype[playerarea[playerid]][0] != AREA_TYPE_PROP) return SendClientMessage2(playerid, COLOR_RED, "You must be at your house to set rent");
	if (areatype[playerarea[playerid]][1] != dini_Int(AddDirFile(dir_userfiles, playername), "propowned")) return SendClientMessage2(playerid, COLOR_RED, "You do not own this house!");
	if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethousetorent [amount] (0 to disable)");
	if(id < 0 || id>10000) return SendClientMessage(playerid, COLOR_RED, "Error: Invalid rent cost amount 0-10k");
	format(tmp2, 10, "prop%d", areatype[playerarea[playerid]][1]);
	dini_IntSet(AddDirFile(dir_propfiles, tmp2), "rentcost", id);
	if(id==0)
	{
 		if(dini_Int(AddDirFile(dir_propfiles, tmp2), "rented")==1)
		{
 			format(pname, sizeof(pname), "%s", dini_Get(AddDirFile(dir_propfiles, tmp2), "renter"));
            dini_Unset(AddDirFile(dir_userfiles, pname), "proprented");
			dini_Set(AddDirFile(dir_propfiles, tmp2), "renter", "server");
			dini_IntSet(AddDirFile(dir_propfiles, tmp2), "rented", 0);
			dini_IntSet(AddDirFile(dir_propfiles, tmp2), "rentcost", 0);
			DestroyPickup(ppropids[areatype[playerarea[playerid]][1]]);
			new Float:x, Float:y, Float:z;
			x = dini_Float(AddDirFile(dir_propfiles, tmp2), "X");
			y = dini_Float(AddDirFile(dir_propfiles, tmp2), "Y");
			z = dini_Float(AddDirFile(dir_propfiles, tmp2), "Z");
			dini_Unset(AddDirFile(dir_propfiles, tmp2), "crX");
			dini_Unset(AddDirFile(dir_propfiles, tmp2), "crY");
			dini_Unset(AddDirFile(dir_propfiles, tmp2), "crZ");
			dini_Unset(AddDirFile(dir_propfiles, tmp2), "crA");
			ppropids[areatype[playerarea[playerid]][1]] = CreatePickup(1272, 1, x, y, z, -1);
			format(tmp, 32, "Owner: %s", dini_Get(AddDirFile(dir_propfiles, tmp2), "owner"));
			Update3DTextLabelText(ptextlabel[areatype[playerarea[playerid]][1]], 0x006699EE, tmp);
		}
		dini_IntSet(AddDirFile(dir_userfiles, playername), "openrent", 0);
		DestroyPickup(ppropids[areatype[playerarea[playerid]][1]]);
		new Float:x, Float:y, Float:z;
		x = dini_Float(AddDirFile(dir_propfiles, tmp2), "X");
		y = dini_Float(AddDirFile(dir_propfiles, tmp2), "Y");
		z = dini_Float(AddDirFile(dir_propfiles, tmp2), "Z");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crX");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crY");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crZ");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crA");
		ppropids[areatype[playerarea[playerid]][1]] = CreatePickup(1272, 1, x, y, z, -1);
		format(tmp, 32, "Owner: %s", dini_Get(AddDirFile(dir_propfiles, tmp2), "owner"));
		Update3DTextLabelText(ptextlabel[areatype[playerarea[playerid]][1]], 0x006699EE, tmp);
 		SendClientMessage(playerid, COLOR_SILVER, "You have disabled your house rent status.");
		}
 	else
	{
	    dini_IntSet(AddDirFile(dir_userfiles, playername), "openrent", 1);
	    DestroyPickup(ppropids[areatype[playerarea[playerid]][1]]);
		new Float:x, Float:y, Float:z;
		x = dini_Float(AddDirFile(dir_propfiles, tmp2), "X");
		y = dini_Float(AddDirFile(dir_propfiles, tmp2), "Y");
		z = dini_Float(AddDirFile(dir_propfiles, tmp2), "Z");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crX");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crY");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crZ");
		dini_Unset(AddDirFile(dir_propfiles, tmp2), "crA");
		ppropids[areatype[playerarea[playerid]][1]] = CreatePickup(19524, 1, x, y, z, -1);
		format(tmp, 32, "Owner: %s\nRent Cost: $%d per day", dini_Get(AddDirFile(dir_propfiles, tmp2), "owner"), dini_Get(AddDirFile(dir_propfiles, tmp2), "rentcost"));
		Update3DTextLabelText(ptextlabel[areatype[playerarea[playerid]][1]], 0xffd800EE, tmp);
 		format(str, sizeof(str), "You have setted your house rent cost to $%d.", id);
 		SendClientMessage(playerid, COLOR_YELLOW, str);
	}
	return 1;
}
For example when i open rent to my house, the 3DTextLabel just show

"Owner: Natasha"
"Rent Cost: $1000 per"

Can someone help me to make the 3DLabel show full? Thanks and sorry for my bad english
Reply
#2

"tmp"s length is too low for that format maybe? did you try changing the length of it?

Because you said 32 characters but i definitely count more than 32 characters, when players name is longer than 6 characters and i didnt even add in the character count of price.
Reply
#3

Quote:
Originally Posted by grymtn
View Post
"tmp"s length is too low for that format maybe? did you try changing the length of it?

Because you said 32 characters but i definitely count more than 32 characters, when players name is longer than 6 characters and i didnt even add in the character count of price.
Thanks mate, i changed tmp's length to 100 and works fine
Reply
#4

Glad it helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)