enum h_Info
{
hID,
hOwner[MAX_PLAYER_NAME],
bool:hRentable,
hRentprice,
hLevel,
bool:hClosed,
hSellprice,
bool:hBuyable,
hInteriorPack,
Float:hX,
Float:hY,
Float:hZ,
hInterior,
hVirtualWorld,
}
new HouseInfo[MAX_HOUSES][h_Info];
enum hInteriors
{
intLevel,
Float:intX,
Float:intY,
Float:intZ,
hVirtual,
intModel,
intPrice,
_stars,
}
new IntInfo[][hInteriors] = {
{0,445.04,508.86, 1001.42,12,2,0,1},
{1,2807.62,-1171.90,1025.57,8,15,500000,1}
};
new tmpid;
tmpid = IsPlayerOutHouse(playerid);
if(tmpid != -1 && !IsPlayerInAnyVehicle(playerid))
{
if(HouseInfo[tmpid][hClosed] == true && PlayerInfo[playerid][housenum] != tmpid) return GameTextForPlayer(playerid,"~r~Closed", 3000, 3);
new intpack = HouseInfo[tmpid][hInteriorPack];
SetPlayerPos(playerid, IntInfo[intpack][intX], IntInfo[intpack][intY], IntInfo[intpack][intZ]);
SetPlayerInterior(playerid, tmpid+1);
SetPlayerVirtualWorld(playerid, tmpid+1);
SetPlayerFacingAngle(playerid, IntInfo[intpack][intY]);
SetCameraBehindPlayer(playerid);
PlayerTemp[playerid][tmphouse] = tmpid;
SaveHouse(tmpid);
return 1;
}
new tmpid; tmpid = IsPlayerOutHouse(playerid); if(tmpid != -1 && !IsPlayerInAnyVehicle(playerid)) { if(HouseInfo[tmpid][hClosed] == true && PlayerInfo[playerid][housenum] != tmpid) return GameTextForPlayer(playerid,"~r~Closed", 3000, 3); new intpack = HouseInfo[tmpid][hInteriorPack]; SetPlayerPos(playerid, IntInfo[intpack][intX], IntInfo[intpack][intY], IntInfo[intpack][intZ]); SetPlayerInterior(playerid, tmpid+1); SetPlayerVirtualWorld(playerid, tmpid+1); SetPlayerFacingAngle(playerid, IntInfo[intpack][intY]); SetCameraBehindPlayer(playerid); PlayerTemp[playerid][tmphouse] = tmpid; SaveHouse(tmpid); return 1; } |
stock IsPlayerOutHouse(playerid, extra = 0)
{
new temp = -1, iSize;
if(extra) iSize = 5;
else iSize = 2;
HouseLoop(h)
{
if(HouseInfo[h][hActive] != true) continue;
if(GetPlayerInterior(playerid) == HouseInfo[h][hInterior] && GetPlayerVirtualWorld(playerid) == HouseInfo[h][hVirtualWorld])
{
if(IsPlayerInRangeOfPoint(playerid, iSize, HouseInfo[h][hX], HouseInfo[h][hY], HouseInfo[h][hZ]))
return h;
}
}
return temp;
}
When I spawned or enter a house, I can only see blue sky without interior
Код:
When I spawned or enter a house, I can only see blue sky without interior |
if(tmpid != -1 && !IsPlayerInAnyVehicle(playerid)) { if(HouseInfo[tmpid][hClosed] == true && PlayerInfo[playerid][housenum] != tmpid) return GameTextForPlayer(playerid,"~r~Closed", 3000, 3); new intpack = HouseInfo[tmpid][hInteriorPack]; SetPlayerPos(playerid, IntInfo[intpack][intX], IntInfo[intpack][intY], IntInfo[intpack][intZ]); SetPlayerInterior(playerid, House Interior Id variable); SetPlayerVirtualWorld(playerid, houseid + 1000); SetPlayerFacingAngle(playerid, IntInfo[intpack][intY]); SetCameraBehindPlayer(playerid); PlayerTemp[playerid][tmphouse] = tmpid; SaveHouse(tmpid); return 1; }