Label and pickup does not delete.
#3

This is how I /edithouse create
Code:
new houseid = FreeHouseID();
HouseInfo[houseid][Pickup] = CreatePickup(1273, 23, HouseInfo[houseid][ExteriorPos][0], HouseInfo[houseid][ExteriorPos][1], HouseInfo[houseid][ExteriorPos][2], HouseInfo[houseid][ExteriorWorld]);
			format(housestring, sizeof(housestring), "{70ff83}This house is for sell!\nPrice: %d\nType /buyhouse to buy it\nType /enter to go inside", HouseInfo[houseid][Price]);
			HouseInfo[houseid][Label] = Create3DTextLabel(housestring, COLOR_ORANGE, HouseInfo[houseid][ExteriorPos][0], HouseInfo[houseid][ExteriorPos][1], HouseInfo[houseid][ExteriorPos][2], 40, HouseInfo[houseid][ExteriorWorld], 0);
This is how I /edithouse delete id
Code:
new id;
HouseInfo[id][server_ID] = id;
			DestroyPickup(HouseInfo[id][Pickup]);
			DestroyDynamic3DTextLabel(HouseInfo[id][Label]);
This is how I load:
Code:
for(new i = 0; i < rows && i < MAX_HOUSES; i ++)
	{
if(HouseInfo[i][ForSell] > 0)
		{
			HouseInfo[i][Pickup] = CreatePickup(1273, 23, HouseInfo[i][ExteriorPos][0], HouseInfo[i][ExteriorPos][1], HouseInfo[i][ExteriorPos][2], HouseInfo[i][ExteriorWorld]);
			format(housestring, sizeof(housestring), "{70ff83}This house is for sell!\nPrice: %d\nType /buyhouse to buy it\nType /enter to go inside", HouseInfo[i][Price]);
			HouseInfo[i][Label] = Create3DTextLabel(housestring, COLOR_ORANGE, HouseInfo[i][ExteriorPos][0], HouseInfo[i][ExteriorPos][1], HouseInfo[i][ExteriorPos][2], 40, HouseInfo[i][ExteriorWorld], 0);
		}
		if(HouseInfo[i][ForSell] < 1)
		{
			HouseInfo[i][Pickup] = CreatePickup(1273, 23, HouseInfo[i][ExteriorPos][0], HouseInfo[i][ExteriorPos][1], HouseInfo[i][ExteriorPos][2], HouseInfo[i][ExteriorWorld]);
			format(housestring, sizeof(housestring), "{70ff83}House\nOwner: %s\nType /enter go to inside", HouseInfo[i][Owner]);
			HouseInfo[i][Label] = Create3DTextLabel(housestring, COLOR_ORANGE, HouseInfo[i][ExteriorPos][0], HouseInfo[i][ExteriorPos][1], HouseInfo[i][ExteriorPos][2], 40, HouseInfo[i][ExteriorWorld], 0);
		}
}
Code:
FreeHouseID()
{
	for(new i=1; i<sizeof(HouseInfo); i++)
	{
	    if(HouseInfo[i][server_ID]==0) return i;
	}
	return 0;
}
Reply


Messages In This Thread
Label and pickup does not delete. - by ShadowMortar - 25.01.2019, 18:30
Re: Label and pickup does not delete. - by Wanheda - 25.01.2019, 21:35
Re: Label and pickup does not delete. - by ShadowMortar - 26.01.2019, 11:58
Re: Label and pickup does not delete. - by Wanheda - 26.01.2019, 16:50
Re: Label and pickup does not delete. - by ShadowMortar - 26.01.2019, 16:59
Re: Label and pickup does not delete. - by Dayrion - 26.01.2019, 17:33
Re: Label and pickup does not delete. - by ShadowMortar - 26.01.2019, 17:36

Forum Jump:


Users browsing this thread: 2 Guest(s)