Ejemplo n.º 1
0
        /// <summary> Applies this weapon to the given player, and sets up necessary state. </summary>
        public virtual void Enable(Player p)
        {
            if (!hookedEvents)
            {
                OnPlayerClickEvent.Register(PlayerClickCallback, Priority.Low);
                OnBlockChangingEvent.Register(BlockChangingCallback, Priority.Low);
                hookedEvents = true;
            }

            this.p = p;
            p.ClearBlockchange();
            p.weapon = this;

            if (p.Supports(CpeExt.PlayerClick))
            {
                p.Message(Name + " engaged, click to fire at will");
            }
            else
            {
                p.Message(Name + " engaged, fire at will");
                p.aiming = true;
                aimer    = new AimBox();
                aimer.Hook(p);
            }
        }
Ejemplo n.º 2
0
        protected override void HookEventHandlers()
        {
            OnPlayerDeathEvent.Register(HandlePlayerDeath, Priority.High);
            OnPlayerChatEvent.Register(HandlePlayerChat, Priority.High);
            OnPlayerCommandEvent.Register(HandlePlayerCommand, Priority.High);
            OnBlockChangingEvent.Register(HandleBlockChanging, Priority.High);

            OnPlayerSpawningEvent.Register(HandlePlayerSpawning, Priority.High);
            OnTabListEntryAddedEvent.Register(HandleTabListEntryAdded, Priority.High);
            OnSentMapEvent.Register(HandleSentMap, Priority.High);
            OnJoinedLevelEvent.Register(HandleJoinedLevel, Priority.High);

            base.HookEventHandlers();
        }
Ejemplo n.º 3
0
        protected override void HookEventHandlers()
        {
            OnEntitySpawnedEvent.Register(HandleEntitySpawned, Priority.High);
            OnTabListEntryAddedEvent.Register(HandleTabListEntryAdded, Priority.High);
            OnMoneyChangedEvent.Register(HandleMoneyChanged, Priority.High);
            OnBlockChangingEvent.Register(HandleBlockChanging, Priority.High);
            OnSendingModelEvent.Register(HandleSendingModel, Priority.High);

            OnPlayerConnectEvent.Register(HandlePlayerConnect, Priority.High);
            OnPlayerMoveEvent.Register(HandlePlayerMove, Priority.High);
            OnPlayerSpawningEvent.Register(HandlePlayerSpawning, Priority.High);
            OnJoinedLevelEvent.Register(HandleJoinedLevel, Priority.High);
            OnPlayerChatEvent.Register(HandlePlayerChat, Priority.High);
            OnGettingCanSeeEntityEvent.Register(HandleCanSeeEntity, Priority.High);

            base.HookEventHandlers();
        }