1. Hi, team.

    is possible?

    function PLUGIN:LogEvent(logdata)
    ConVar.Server.Log("oxide/logs/RemoveAAA.txt", logdata)
     
  2. Wulf

    Wulf Community Admin

    To log usage to a file? Sure, but why not use the Logger plugin instead?
     
  3. nice Wulf.

    i love you!!!

    very very thank

    =D
     
  4. You might want to change the Permission function to this:
    Code:
            bool HasPermission(ConsoleSystem.Arg arg, string permission)
            {
                if (arg.isAdmin || arg.connection == null) return true;
                return this.permission.UserHasPermission(arg.connection.userid.ToString(), Title.ToLower() + "." + permission);
            }
    else your code makes no sense (how can you be admin and not be a connection at the same time, not to mention the redundant check for connection which is already catched be the first if)
     
  5. You are completely right! Thank you for the support. :)
     
  6. Tuntenfisch updated RemoveAAA with a new update entry:

    0.3.3

     
  7. Could you add a black list to prohibit certain items?
     
  8. Tuntenfisch updated RemoveAAA with a new update entry:

    0.4.0


    [DOUBLEPOST=1460209981][/DOUBLEPOST]
    Here you go, take a look at the overview section for usage.
     
  9. Players are able to spawn stuff over the f1 menu since 0.4.0 when you use CommandBlocker and RemoveAA. This didnt happen with 0.3.2

    [Warning] Calling hook OnRunCommand resulted in a conflict between the following plugins: commandblock, RemoveAAA
     
  10. Odd, I didn't really change anything that would cause this. Could you tell me if the same happens with v. 0.3.3?
     
  11. Same with 0.3.3 players can spawn.
     
  12. Hmm so it seems like the reason why people are able to spawn in stuff regardless of their permissions is because of the conflict. Sadly I don't know how to resolve this at the moment. I advise you to just stay on version 0.3.2 for the time being.
     
  13. Hmm, I just checked arg.isAdmin and arg.cmd.isAdmin and both are true for me (so it at least can't be that)

    Looking trough the OnRunCommand code make me wonder though, why call arg.Player() this much, and then put a variable that returns when there's no player object... imo this should be on top and the rest of the code use that variable... (Hello performance)

    This also slims down the if checks so that you can use the ChatMessage's after the actual condition (which helps make things easier to read)
    Then you have a lot of checks for each command that could be probably merged into global checks (so that checks are atomic) ex.
    the check if ItemManager.CreateByPartialName is null could be put above the command specific code. In the end this not only improves performance but also reduces the points where things can go wrong (for example copy&paste errors)


    While working on that I'll try to come up with a plan to tackle that warning, or at least come up with a trick to prevent people being able to use the command even if there's a conflict, or something like that...
     
  14. I pretty much copied the implementation from Facepunch's code, just leaving out the global notification that something has been spawned in. Then I added all the permission checks and stuff. I'm aware it's not ideal but I rushed the first version of this plugin and never got back to cleaning it all up.
     
  15. Anyway, you can actually override commands by registering them, if it doesn't exist the command is created, if it does it'll be added to a list.
    Meaning each plugin can run their specific code when a command is run.

    It'd be probably best to do it this way then to override OnRunCommand (same goes to CommandBlock...)
     
    Last edited by a moderator: Apr 9, 2016
  16. I changed the last lines of permissions from the version 0.3.2 and now my players can not take the object.
    Code:
     bool HasPermission(ConsoleSystem.Arg arg, string permission)
            {
                if (arg.cmd.isAdmin && arg.connection == null) return true;
                if (arg.connection != null) return this.permission.UserHasPermission(arg.connection.userid.ToString(), Title.ToLower() + "." + permission);
                return false;
            }
    [DOUBLEPOST=1460225387][/DOUBLEPOST]I do not know how to, but it works for me
     
  17. So by doing something like this:
    Code:
    [ConsoleCommand("giveid")]
    void GiveIDCommand(ConsoleSystem.Arg arg)
    {
        // do something
    }
    It would override the existing "giveid" command that Rust has? I tried that but it basically never got called. Rust's "giveid" got called, tho.
    [DOUBLEPOST=1460225540][/DOUBLEPOST]
    Does he have the necessary permissions?
     
  18. set permissions only for admins. for the other players says you do not have usage rights
    I mean a mistake with the issue of items to all players
     
  19. Wulf

    Wulf Community Admin

    There is no "giveid" console command technically, you'd need to replace global.giveid I believe. The global is the part you do not see as it is assumed.
     
  20. Oh I forgot about that. Good call!