Exemplo n.º 1
0
        public void InsideInterior(int interior, int hash, Vector3 pos)
        {
            PlayerGenerics.DisableInteriorControlsThisFrame();

            Function.Call(Hash.SET_RADAR_AS_INTERIOR_THIS_FRAME, hash, pos.X, pos.Y, pos.Z, 0);
            Function.Call(Hash._SET_PLAYER_BLIP_POSITION_THIS_FRAME, pos.X, pos.Y);

            Player me = Game.Player;

            foreach (Player player in Players)
            {
                if (me == player)
                {
                    continue;
                }

                PlayerGenerics.SetFlag(player, PlayerFlag.HeadDisplayHidden | PlayerFlag.BlipHidden, true);

                // Player is in interior
                if (PlayerInterior.IsIn(player, interior))
                {
                    // Player is guest in current player's interior
                    if (PlayerInterior.GetInteriorOwner(player) == Game.Player.Handle)
                    {
                        PlayerGenerics.Show(player);
                    }
                    else
                    {
                        PlayerGenerics.Hide(player);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void OutsideInterior()
        {
            Function.Call(Hash.SET_RADAR_AS_EXTERIOR_THIS_FRAME);
            Function.Call(Hash.UNLOCK_MINIMAP_POSITION);

            foreach (Player player in Players)
            {
                if (Game.Player == player)
                {
                    continue;
                }

                if (!PlayerInterior.IsInAny(player))
                {
                    PlayerGenerics.SetFlag(player, PlayerFlag.HeadDisplayHidden | PlayerFlag.BlipHidden, false);
                    PlayerGenerics.Show(player);
                }
            }
        }
Exemplo n.º 3
0
        protected void BeginTransitionInside(Player owner = null)
        {
            State = PlayerApartmentState.TransitionInside;

            Game.Player.CanControlCharacter = false;
            Game.PlayerPed.IsInvincible     = true;
            Game.PlayerPed.Weapons.Select(PlayerGenerics.Unarmed);

            PlayerGenerics.SetFlag(Game.Player, PlayerFlag.Hidden, true);
            PlayerGenerics.SetFlag(Game.Player, PlayerFlag.BlipHidden, true);

            PlayerInterior.SetInteriorId(Game.Player, CurrentApartment.InteriorId);
            if (owner == null)
            {
                PlayerInterior.SetInterOwnerToMyself(Game.Player);
            }
            else
            {
                PlayerInterior.SetInteriorOwner(Game.Player, owner);
            }
        }
Exemplo n.º 4
0
        protected async Task OnTick()
        {
            foreach (Player player in Players)
            {
                // No need to make head display for youself, huh
                if (player == LocalPlayer)
                {
                    //continue;
                }

                if (PlayerGenerics.HasFlag(player, PlayerFlag.HeadDisplayHidden))
                {
                    Hide(player);
                }
                else
                {
                    Show(player);
                }
            }

            await Delay(10);
        }