Label and pickup does not delete.
#1

Code:
if(strcmp(option, "delete", true) == 0)
		{
			new id, query[50];
			if(sscanf(params, "s[6]d", option, id))
			{
				SendClientMessage(playerid, COLOR_GREY, "Usage: {FFFFFF}/edithouse delete [ID]");
				return 1;
			}
			HouseInfo[id][server_ID] = id;
			DestroyPickup(HouseInfo[id][Pickup]);
			DestroyDynamic3DTextLabel(HouseInfo[id][Label]);
			format(str, sizeof(str), "You've successfully deleted house id %d", HouseInfo[id][server_ID]);
			SendClientMessage(playerid, COLOR_GREY, str);
			format(query, sizeof(query), "DELETE FROM houses WHERE server_ID='%i'", HouseInfo[id][server_ID]);
			mysql_function_query(dbhandle, query , true, "", "");
			return 1;
		}
In sql it does delete.
Reply
#2

Creation code?
Are you using streamer for pickups aswell?
Reply
#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
#4

You are not even using dynamic 3D text labels..
Reply
#5

what about the pickup
Reply
#6

Probably id are mixed up. You should debug your code properly. Noboyd will give you a magic answer
Reply
#7

Fixed, nvm
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)