12.03.2015, 12:06
(
Последний раз редактировалось LegendOfScripts; 12.03.2015 в 15:08.
)
I keep getting unknown command instead of You are not near your house, It works when I enter the house and before I buy it, But after I buy it constantly unknown command if your not near it.
crash detect plugin
Код:
CMD:furniture(playerid, params[])
{
new key = GetPlayerInOwnedHouse(playerid);
if(GetPVarInt(playerid,"HouseKey_1") == 1000) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error: You do not own a house!");
if(IsPlayerInRangeOfPoint(playerid, 50.0,HouseInfo[key][HouseIntPos][0],HouseInfo[key][HouseIntPos][1],HouseInfo[key][HouseIntPos][2]) && GetPlayerVirtualWorld(playerid) == HouseInfo[key][Vw])
{
HouseKeyForFurniture[playerid] = key;
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!");
}
stock GetPlayerInOwnedHouse(playerid) //Get's the ID Of the closest house to the player if they are withing a range of 3.0
{
for(new h = 0; h < MAX_OWNABLE_HOUSES+1;h++)
{
new string1[128];
format(string1, sizeof(string1), "HouseKey_%d", h+1);
if(IsPlayerInRangeOfPoint(playerid, 50.0,HouseInfo[GetPVarInt(playerid,string1)][HouseIntPos][0],HouseInfo[GetPVarInt(playerid,string1)][HouseIntPos][1],HouseInfo[GetPVarInt(playerid,string1)][HouseIntPos][2]) && GetPlayerVirtualWorld(playerid) == HouseInfo[GetPVarInt(playerid,string1)][Vw])
{
return h+1;
}
}
return 1;
}


