Ejemplo 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);
         }
     }
 }
Ejemplo n.º 2
0
 public void SetPlayerFlag(E_PlayerFlags _f, bool _b)
 {
     if (_b)
     {
         if (!this.HasPlayerFlag(_f))
         {
             this.PlayerFlags |= _f;
         }
     }
     else
     {
         if (this.HasPlayerFlag(_f))
         {
             this.PlayerFlags &= ~_f;
         }
     }
 }
Ejemplo n.º 3
0
 public void SetPlayerFlag(E_PlayerFlags f, bool b)
 {
     if (b)
     {
         if (!this.HasPlayerFlag(f))
         {
             this.PlayerFlags |= f;
         }
     }
     else
     {
         if (this.HasPlayerFlag(f))
         {
             this.PlayerFlags &= ~f;
         }
     }
 }
Ejemplo n.º 4
0
 public bool HasPlayerFlag(E_PlayerFlags _f) => ((this.PlayerFlags & _f) == _f);
Ejemplo n.º 5
0
 public bool HasPlayerFlag(E_PlayerFlags f) => ((this.PlayerFlags & f) == f);