public static bool IsPlayerBlock(this IMyCubeBlock Block, out IMyPlayer Owner)
 {
     Owner = null;
     if (Block.OwnerId != 0)
     {
         return(MyAPIGateway.Players.IsValidPlayer(Block.OwnerId, out Owner));
     }
     else
     {
         long BuiltBy = Block.GetBuiltBy();
         if (BuiltBy == 0)
         {
             return(false);
         }
         Owner = MyAPIGateway.Players.GetPlayerByID(BuiltBy);
         return(Owner != null && !Owner.IsBot);
     }
 }
Exemple #2
0
 public static bool IsPlayerBlock(this IMyCubeBlock block, out IMyPlayer owner)
 {
     owner = null;
     if (block.OwnerId != 0)
     {
         return(MyAPIGateway.Players.IsValidPlayer(block.OwnerId, out owner));
     }
     else
     {
         long builtBy = block.GetBuiltBy();
         if (builtBy == 0)
         {
             return(false);
         }
         owner = MyAPIGateway.Players.GetPlayerById(builtBy);
         return(owner != null && !owner.IsBot);
     }
 }
 public static bool IsBuiltByNobody(this IMyCubeBlock Block)
 {
     return(Block.GetBuiltBy() == 0);
 }