1. I am trying to get the steamid of every player that joined to my server.
    I know it is saved on a sort of db but I have know idea where to loop and if it is accesible from plugins.

    Something like this.
    Code:
    foreach (var data in userdatabase)
                {
                    Puts(data.UserIDString);
                }
     
  2. Are you saying userdatabase is like: storage.db in your server files? I don't think that itself is readable by a plugin. I'd say your best bet is to create a dictionary when a player joins or a SQL data base. There might be a way to read the .db though.
     
  3. Wulf

    Wulf Community Admin

    Storage.db isn't for player information last I saw, only signs.

    Oxide stores player data when players connect in the oxide.covalence.data though, which you can access using Oxide's API. There are also plugins that handle this.
     
  4. Ah I was not 100% of what storage.db was.
     
  5. Code:
    foreach (var entry in covalence.Players.GetAllPlayers())
                {
                    Puts(entry.ToString());
                }
    I think that will work. Thank you Wulf.
     
  6. Will check out your code as i'm assuming you mean has ever joined the server, which is a good question. Here's code that gives sleeping and active player list

    Code:
             var Sleeping = BasePlayer.sleepingPlayerList as List<BasePlayer>;
                foreach( BasePlayer player in Sleeping)
                {
                    //do something with player.userID
                }
    
    Code:
    var Active = BasePlayer.activePlayerList as List<BasePlayer>;
                foreach( BasePlayer player in Active)
                {
                    //do something with player.userID
                }  
    
     
  7. Wulf

    Wulf Community Admin

    That won't handle players if they aren't sleeping or active, what the OP posted is a better way of handling it.
    [DOUBLEPOST=1470333147,1470333128][/DOUBLEPOST]
    That would work, but you'd want to use entry.Id to get the actual ID only.
     
  8. Solved
    Code:
    foreach (var entry in covalence.Players.GetAllPlayers())
                {
                    string permisos = string.Join(", ", permission.GetUserPermissions(entry.Id.ToString()));
                    if (String.IsNullOrEmpty(permisos)) continue;
                    string usuario = entry.Name.Replace("'", "");
                    Usado(usuario, entry.Id, permisos);
                }