12.03.2015, 13:15
pawn Код:
//Put that somerwhere high
#define INVALID_HOUSE_ID (1000)
//And this where it was
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[24],
key
;
format(string1, sizeof(string1), "HouseKey_%d", h+1);
key = GetPVarInt(playerid, string1);
if (key == INVALID_HOUSE_ID) {
continue;
}
if(IsPlayerInRangeOfPoint(playerid, 50.0,HouseInfo[key][HouseIntPos][0],HouseInfo[key][HouseIntPos][1],HouseInfo[key][HouseIntPos][2]) && GetPlayerVirtualWorld(playerid) == HouseInfo[key][Vw])
{
return h+1;
}
}
//We need to return invalid ID if house is not near someone
return INVALID_HOUSE_ID;
}

