11.03.2013, 11:58
Well I got an issue. Each time player enters a house he gets teleported to an interior but he cannot see it. No one can see the interior even if you are inside of it. There are walls etc. but you cannot see them.
Usage of the CreateHouse is
Create house fully explained
Entering the house
Interior is like invisible but you are inside of it.
Код:
CreateHouse("Bayside Nr.1", 200000, -2348.9600,2422.9646,7.3428, 1.808619,32.384357,1199.593750, 100000, 1);
Код:
CreateHouse(HouseName[], CostP, Float:EnterX, Float:EnterY, Float:EnterZ, Float:TeleX, Float:TeleY, Float:TeleZ, SellP, Interiorx)
Код:
stock CreateHouse(HouseName[], CostP, Float:EnterX, Float:EnterY, Float:EnterZ, Float:TeleX, Float:TeleY, Float:TeleZ, Interiorx, SellP) { format(HouseInformation[houseid][Hname], 100, "%s", HouseName); HouseInformation[houseid][costprice] = CostP; HouseInformation[houseid][EnterPos][0] = EnterX; HouseInformation[houseid][EnterPos][1] = EnterY; HouseInformation[houseid][EnterPos][2] = EnterZ; HouseInformation[houseid][TelePos][0] = TeleX; HouseInformation[houseid][TelePos][1] = TeleY; HouseInformation[houseid][TelePos][2] = TeleZ; HouseInformation[houseid][sellprice] = SellP; HouseInformation[houseid][interiors] = Interiorx; format(fquery, sizeof(fquery), "SELECT houseowner FROM HOUSEINFO WHERE housename = '%s'", HouseName); queryresult = db_query(database, fquery); if(db_num_rows(queryresult) != 0) db_get_field_assoc(queryresult, "houseowner", HouseInformation[houseid][owner], 24); HouseInformation[houseid][checkpointidx][0] = CreateDynamicCP(EnterX, EnterY, EnterZ, 1.0); HouseInformation[houseid][checkpointidx][1] = CreateDynamicCP(TeleX, TeleY, TeleZ, 1.0, 15500000+houseid, Interiorx); if(!HouseInformation[houseid][owner][0]) format(fquery, sizeof(fquery), "House Name: %s \n House Price:$%d \n Sell Price: $%d", HouseName, CostP, SellP); else if(HouseInformation[houseid][owner][0] != 0) format(fquery, sizeof(fquery), "House Name: %s \n Owner: %s", HouseName, HouseInformation[houseid][owner]); HouseInformation[houseid][textid] = CreateDynamic3DTextLabel(fquery, 0xFFFFFF, EnterX, EnterY, EnterZ + 0.5, 50.0); houseid ++; return 1; }
Код:
forward OnPlayerEnterDynamicCP(playerid, checkpointid); public OnPlayerEnterDynamicCP(playerid, checkpointid) { for(new x; x<houseid; x++) { if(HouseInformation[x][checkpointidx][0] == checkpointid) { if(InHouse[playerid] != -1) { InHouse[playerid] = -1; return 1; } InHouseCP[playerid] = x; new Pname[24]; GetPlayerName(playerid, Pname, 24); if(HouseInformation[x][owner][0] != 0 && !strcmp(Pname, HouseInformation[x][owner][0])) { SetPlayerPos(playerid, HouseInformation[x][TelePos][0], HouseInformation[x][TelePos][1], HouseInformation[x][TelePos][2]); SetPlayerInterior(playerid, HouseInformation[x][interiors]); SetPlayerVirtualWorld(playerid, 15500000 + x); } if(!HouseInformation[x][owner][0]) SendClientMessage(playerid, -1, "This house is for sale /buy to buy it!"); return 1; } if(HouseInformation[x][checkpointidx][1] == checkpointid) { if(InHouse[playerid] == -1) { InHouse[playerid] = x; return 1; } SetPlayerPos(playerid, HouseInformation[x][EnterPos][0], HouseInformation[x][EnterPos][1], HouseInformation[x][EnterPos][2]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); return 1; } } return 1; }