General > Developers Corner

(Someone) did something to whoever

<< < (2/2)

Caiin:
I understand this is a necro, however creating a new post seems irrelevant as all the required info is here.

Regarding Timmy's comment, is it possible to make it so that a specific user or steamid's commands are shown as anonymous or console, while others are identified?

Timmy:

--- Quote from: Caiin on July 01, 2017, 11:51:24 PM ---Is it possible to make it so that a specific user or steamid's commands are shown as anonymous or console, while others are identified?

--- End quote ---

An easy way to achieve this is simply using rcon for commands when you don't want to be identified. But it can get annoying to prepend !rcon before every command, and access to rcon can only be given to people you fully trust.

A better solution might be to change the value of ulx logEcho depending on who runs the command with a script.

Example:

--- Code: ---local anonymous = {
    ["STEAM_0:0:12345678"] = true,
    ["STEAM_0:0:57225082"] = true,
}

hook.Add( ULib.HOOK_COMMAND_CALLED, "cypherpunk", function( ply, cmd, args )
    if args[1] == "logecho" then return end

    if ply:IsValid() and anonymous[ ply:SteamID() ] then
        ulx.cvars.logecho.obj:SetInt( 1 )
    else
        ulx.cvars.logecho.obj:SetInt( 2 )
    end
end, HOOK_MONITOR_HIGH )
--- End code ---

I have attached this example to my post in addon format. You can edit ulx-anonymous/lua/ulx/modules/anonymous.lua and add the SteamIDs that should be shown as anonymous to the anonymous table.

Navigation

[0] Message Index

[*] Previous page

Go to full version