Some things not working right.
#1

Will rep anyone that helps.

Okay, This command only works for the players first house, It's meant to work for all houses.

Код:
CMD:furniture(playerid, params[])
{
    new string[128];
	for(new h = 0; h < MAX_OWNABLE_HOUSES+1;h++)
	{
		format(string, sizeof(string), "HouseKey_%d", h+1);
		if(GetPVarInt(playerid,"HouseKey_1") == 1000) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You do not own a house!");
		if(IsPlayerInRangeOfPoint(playerid, 50.0,HouseInfo[GetPVarInt(playerid,string)][HouseIntPos][0],HouseInfo[GetPVarInt(playerid,string)][HouseIntPos][1],HouseInfo[GetPVarInt(playerid,string)][HouseIntPos][2]) && GetPlayerVirtualWorld(playerid) == HouseInfo[GetPVarInt(playerid,string)][Vw])
		{
		    HouseKeyForFurniture[playerid] = h;
		    SendClientMessage(playerid, COLOR_ORANGE, "Note: Go to your house interior and type /showhouseinfo to show the Object ID's and their position to remove from");
		    SendClientMessage(playerid, COLOR_ORANGE, "Note: You must be in a range of 3.0 meters of the object *May Course lag if its more*");
			ShowPlayerDialog(playerid, HouseFurniture, DIALOG_STYLE_LIST, "Furniture Menu", "Add Furniture\nRemove Furniture by ID\nRemove Closest Furniture\nRemove All Furniture", "Continue", "Cancel");
	 		return 1;
	  	}
	  	else return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not near any of your houses!");
	}
	return 1;
}
This code doesn't work at all, It doesn't show the textlabel but says the you don't own a house if you don't own one.
Код:
CMD:showhouseinfo(playerid, params[])
{
    new string[128];
    if(GetPVarInt(playerid,"HouseInfoDisplay") == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are already showing a houses information!");
	for(new h = 0; h < MAX_OWNABLE_HOUSES+1;h++)
	{
		format(string, sizeof(string), "HouseKey_%d", h+1);
		if(GetPVarInt(playerid,"HouseKey_1") == 1000) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You do not own a house!");
		if(IsPlayerInRangeOfPoint(playerid, 50.0,HouseInfo[GetPVarInt(playerid,string)][HouseIntPos][0],HouseInfo[GetPVarInt(playerid,string)][HouseIntPos][1],HouseInfo[GetPVarInt(playerid,string)][HouseIntPos][2]) && GetPlayerVirtualWorld(playerid) == HouseInfo[h][Vw])
		{
		    for(new f = 0; f < MAX_FURNITURE;f++)
			{
				format(string, sizeof(string), "ObjectID%i", f);
				if(HouseInfo[GetPVarInt(playerid,string)][ObjectID][h] > 0)
				{
			    	new string1[256];
		        	format(string1, sizeof(string1), "Object ID: %d", f);
			    	Object3D[f] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, HouseInfo[GetPVarInt(playerid,string)][ObjectPosX][f], HouseInfo[GetPVarInt(playerid,string)][ObjectPosY][f], HouseInfo[GetPVarInt(playerid,string)][ObjectPosZ][f]+0.75, 3.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, HouseInfo[GetPVarInt(playerid,string)][ObjectVW][f], HouseInfo[GetPVarInt(playerid,string)][ObjectInt][f], playerid, 100.0);
			    	return 1;
		 		}
			}
	  	}
	  	else return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You are not near any of your houses!");
	}
	return 1;
}
And now this Dialog won't work to remove objects.

Код:
case 2:
				{
				    for(new h = 0; h < MAX_FURNITURE;h++)
					{
					    new i = HouseKeyForFurniture[playerid];
					    if(IsPlayerInRangeOfPoint(playerid, 5.0,HouseInfo[i][ObjectPosX][h], HouseInfo[i][ObjectPosY][h], HouseInfo[i][ObjectPosZ][h]) && GetPlayerVirtualWorld(playerid) == HouseInfo[h][Vw])
					    {
					        new ModelFile[124];
			  				new key = HouseKeyForFurniture[playerid];
			    			new String[124];
				    		format(ModelFile,sizeof(ModelFile),"Houses/furnhouse%i.ini",key);
				    		format(String,sizeof(String),"ObjectID%i",listitem);
			    			HouseInfo[key][ObjectID][h] = 0;
							DOF2_SetInt(ModelFile,String,0);
							DestroyDynamicObject(HouseObject[key][h]);
							format(String,sizeof(String),"Furniture Object ID [%d] deleted.", h);
							SendClientMessage(playerid, 0x42F3F198, String);
							return 1;
					    }
					}
				}
Reply


Messages In This Thread
Some things not working right. - by LegendOfScripts - 11.03.2015, 22:54
Re: Some things not working right. - by Vince - 11.03.2015, 23:03
Re: Some things not working right. - by LegendOfScripts - 11.03.2015, 23:12
Re : Some things not working right. - by Golimad - 12.03.2015, 00:40

Forum Jump:


Users browsing this thread: 1 Guest(s)