Interior Problems..
#1

Sometimes when someone enters a building using /enter command its changing to other player who is standing nearby the interior, why this is happening?
here's some code:
pawn Код:
CMD:enter(playerid, params[])
{
    for(new idx=0; idx<MAX_DOORS; idx++) // Dynamic Doors
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
        {
            if(!DoorInfo[idx][fDoor])
            {
                if(DoorInfo[idx][dIInt] == 83 && DoorInfo[idx][dIVW] == 8473 && BankBlock)
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can't enter the bank as it is being robbed at the moment.");
                    return 1;
                }
                if(DoorInfo[idx][dCInt])
                {
                    GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 4);
                    TogglePlayerControllable(playerid, 0);
                    SetTimerEx("EnterExitTimer", 2000, false, "i", playerid);
                    PlayerInfo[playerid][pSpawnFreeze] = 1;
                }
                PlayerInfo[playerid][pSpawnFreeze] = 0;
                SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
                SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
                SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
                SetCameraBehindPlayer(playerid);
                SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
                TogglePlayerControllable(playerid, 0);
                SetTimerEx("EnterExitTimer", 2000, false, "i", playerid);
                return 1;
            }
            else
            {
                if(PlayerInfo[playerid][pDynamicFac] == DoorInfo[idx][fDoor])
                {
                    if(IsPlayerInRangeOfPoint(playerid, 2, DoorInfo[idx][dOX], DoorInfo[idx][dOY], DoorInfo[idx][dOZ]))
                    {
                        if(DoorInfo[idx][dIInt] == 83 && DoorInfo[idx][dIVW] == 8473 && BankBlock)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "You can't enter the bank as it is being robbed at the moment.");
                            return 1;
                        }
                        if(DoorInfo[idx][dCInt])
                        {
                            GameTextForPlayer(playerid, "~w~Loading Objects", 3500, 4);
                            TogglePlayerControllable(playerid, 0);
                            SetTimerEx("EnterExitTimer", 2000, false, "i", playerid);
                            PlayerInfo[playerid][pSpawnFreeze] = 1;
                        }
                        PlayerInfo[playerid][pSpawnFreeze] = 0;
                        SetPlayerInterior(playerid, DoorInfo[idx][dIInt]);
                        SetPlayerVirtualWorld(playerid, DoorInfo[idx][dIVW]);
                        SetPlayerFacingAngle(playerid, DoorInfo[idx][dIA]);
                        SetCameraBehindPlayer(playerid);
                        SetPlayerPos(playerid, DoorInfo[idx][dIX], DoorInfo[idx][dIY], DoorInfo[idx][dIZ]);
                        TogglePlayerControllable(playerid, 0);
                        SetTimerEx("EnterExitTimer", 2000, false, "i", playerid);
                        return 1;
                    }
                }
                else SendClientMessage(playerid, COLOR_GREY, "This door is faction restricted.");
                return 1;
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)