19.10.2016, 08:31
Hello guys, let's just get right to the point,
so once I made enterable houses, when I start trying them and see if there are any bugs, I bumped with this very annoying bug which when you try to get out of the house, I doesn't teleport you to the house's entrance, it teleports you to an the first created houses with the same house interior virtual world, in other words,
I created houses A with interior 1, and then I created like 10 or 9 other houses with different interiors and virtual world, so ifI go ahead and create and other house B with the same interior as the houses A, if I tried to exit it, I will get teleported to the entrance of the house A not B, you got what I mean?
Please help, there is the code of entering/exiting the house
so once I made enterable houses, when I start trying them and see if there are any bugs, I bumped with this very annoying bug which when you try to get out of the house, I doesn't teleport you to the house's entrance, it teleports you to an the first created houses with the same house interior virtual world, in other words,
I created houses A with interior 1, and then I created like 10 or 9 other houses with different interiors and virtual world, so ifI go ahead and create and other house B with the same interior as the houses A, if I tried to exit it, I will get teleported to the entrance of the house A not B, you got what I mean?
Please help, there is the code of entering/exiting the house
PHP код:
for(new i=0; i<MAX_HOUSES;i++){
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[i][hEnterX],HouseInfo[i][hEnterY],HouseInfo[i][hEnterZ])){
if(HouseInfo[i][hOwned] == 0){
SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
SetPlayerInterior(playerid, HouseInfo[i][hInsideVir]);
}
else if(HouseInfo[i][hOwned] == 1){
if(!strcmp(name, HouseInfo[i][hOwner], false, 24)){
SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
SetPlayerInterior(playerid, HouseInfo[i][hInsideInt]);
SetPlayerVirtualWorld(playerid, HouseInfo[i][hInsideVir]);
PlayerInfo[playerid][InHouse] = true;
SendClientMessage(playerid, ORANGE, "[SERVER]: {FFFFFF}Welcome inside your house!");
return 1;
}
else{
SendClientMessage(playerid, RED, "[SERVER]: {FFFFFF}This is not your house!");
}
}
}
else if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[i][hExitX],HouseInfo[i][hExitY],HouseInfo[i][hExitZ])){
SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
SetPlayerInterior(playerid, HouseInfo[i][hOutsideInt]);
SetPlayerVirtualWorld(playerid, HouseInfo[i][hOutsideVir]);
PlayerInfo[playerid][InHouse] = false;
return 1;
}
}