Esempio n. 1
0
 public override void OnEntityUpdate(Entity entity)
 {
     base.OnEntityUpdate(entity);
     if (entity.basePlayer != null)
     {
         SteamID     = entity.basePlayer.userid;
         Username    = entity.basePlayer.name;
         PlayerFlags = (E_PlayerFlags)entity.basePlayer.playerFlags;
         if (entity.basePlayer.modelState != null)
         {
             ModelState = entity.basePlayer.modelState.Copy();
         }
         if (HasPlayerFlag(E_PlayerFlags.IsAdmin))
         {
             IsServerAdmin = true;
         }
         if (entity.basePlayer.heldEntity == 0)
         {
             this.ActiveItem = null;
         }
         else if ((this.ActiveItem == null || this.ActiveItem.UID != entity.basePlayer.heldEntity + 1) &&
                  HasNetworkable(entity.basePlayer.heldEntity + 1))
         {
             OnChangeActiveItem(entity.basePlayer.heldEntity);
         }
     }
 }
Esempio n. 2
0
 public void OnChangeActiveItem(UInt32 activeItem)
 {
     this.ActiveItem = (BaseHeldEntity)ListNetworkables[activeItem + 1];
     if (this.IsLocalPlayer && this.HasActiveItem)
     {
         ConsoleSystem.Log("You use: " + this.ActiveItem.PrefabID + " Ammotype =>" + this.ActiveItem.AmmoType);
     }
 }