01.02.2020, 01:38
Find Entrance_Nearest procedure. Under that procedure add:
Find the following line of code:
Comment out that If Statement and then under that section, add the following:
This should work. There's probably a better way to simplify this, but this is what works for me.
Code:
Exit_Nearest(playerid) { for (new i = 0; i != MAX_ENTRANCES; i ++) if (EntranceData[i][entranceExists] && IsPlayerInRangeOfPoint(playerid, 2.5, EntranceData[i][entranceInt][0], EntranceData[i][entranceInt][1], EntranceData[i][entranceInt][2])) { if (GetPlayerInterior(playerid) == EntranceData[i][entranceInterior] && GetPlayerVirtualWorld(playerid) == EntranceData[i][entranceWorld]) { return i; } } return -1; }
Code:
if ((id = Entrance_Inside(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, EntranceData[id][entranceInt][0], EntranceData[id][entranceInt][1], EntranceData[id][entranceInt][2]))
Code:
if ((id = Exit_Nearest(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, EntranceData[id][entranceInt][0], EntranceData[id][entranceInt][1], EntranceData[id][entranceInt][2])) { if (EntranceData[id][entranceCustom]) SetPlayerPosEx(playerid, EntranceData[id][entrancePos][0], EntranceData[id][entrancePos][1], EntranceData[id][entrancePos][2]); else SetPlayerPosEx(playerid, EntranceData[id][entrancePos][0], EntranceData[id][entrancePos][1], EntranceData[id][entrancePos][2]); SetPlayerFacingAngle(playerid, EntranceData[id][entrancePos][3] - 180.0); SetPlayerInterior(playerid, EntranceData[id][entranceExterior]); SetPlayerVirtualWorld(playerid, EntranceData[id][entranceExteriorVW]); SetCameraBehindPlayer(playerid); PlayerData[playerid][pEntrance] = Entrance_GetLink(playerid); return 1; }