where would i start to making a Incognito admin mode

Hello,

So basically with this…

a SA+ can run /incognito ( RP NAME )

and it will remove rank view from the user… but they will still have the perms of the rank…

basically its to RP without being called…

it makes other users/staff think ur a normal user.

i will like this as a fadmin chat command

and when i go into manage permission for fadmin i would like to be a permission which can be given to a rank

and hooks like

if not ply:IsIncognito()

Well, one way is to return different info on SteamID, Nick, etc. You’d also want to display a different rank depending on how ULX shows your ranks to people.

how would this be done?

cause i need defo function
if not ply:IsIncognito()

etc

This is from “dankpepe” on ulysses, full credit to him(http://forums.ulyssesmod.net/index.php/topic,9834.0.html) This should work. Put it in a lua file in ulx/modules/sh/yourfile.lua
(Assuming you’re running Ulx/Ulib


local CATEGORY_NAME = "Utility"



function ulx.undercover( calling_ply, under_name, should_revoke )
   


  local id = calling_ply:SteamID()  
  ULib.ucl.userAllow(id,"ulx uncover",false)



  if !should_revoke then

    
    calling_ply.undercover_table_name = {}
    calling_ply.undercover_table_rank = {}
    table.insert( calling_ply.undercover_table_rank, 0, calling_ply:GetUserGroup() )
    table.insert( calling_ply.undercover_table_name, 0, calling_ply:Name() )


    calling_ply:setRPName(under_name)

    calling_ply:SetUserGroup("user")


    local undercover_rank = calling_ply.undercover_table_rank[0]

    repeat
      ULib.ucl.userAllow(id, ULib.ucl.groups[undercover_rank].allow,false)
      undercover_rank = ULib.ucl.groups[undercover_rank].inherit_from
    until undercover_rank == "user"

 



  else
 



    calling_ply:setRPName(calling_ply.undercover_table_name[0])



    calling_ply:SetUserGroup(calling_ply.undercover_table_rank[0])




    local undercover_rank = calling_ply.undercover_table_rank[0]

    repeat
      ULib.ucl.userAllow(id, ULib.ucl.groups[undercover_rank].allow,true)
      undercover_rank = ULib.ucl.groups[undercover_rank].inherit_from
    until undercover_rank == "user"





  end

end


local undercover = ulx.command( CATEGORY_NAME,"ulx undercover", ulx.undercover, "!undercover", true )
undercover:addParam{ type=ULib.cmds.StringArg, hint="{name}", ULib.cmds.optional }
undercover:addParam{ type=ULib.cmds.BoolArg, invisible=true }
undercover:defaultAccess( ULib.ACCESS_SUPERADMIN )
undercover:help( "Go undercover" )
undercover:setOpposite("ulx uncover", { _, _, true }, "!uncover" )





can u add them functions?

cause when the user goes undercover it makes all they ranks on the hud/scoreboard clear

[editline]31st December 2016[/editline]

[ERROR] addons/ulx/lua/ulx/modules/sh/undercover.lua:56: attempt to index a nil value

  1. call - addons/ulx/lua/ulx/modules/sh/undercover.lua:56
  2. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
    3. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
    4. Run - lua/includes/modules/concommand.lua:54
    5. unknown - addons/ulib/lua/ulib/shared/commands.lua:1311
    6. unknown - lua/includes/modules/concommand.lua:54

the code u posted… makes them

you could create a fake rank with the same name and colour as user, but its actually superadmin

Well he also would want it to hide his name as well, basically act as another user.

Otherwise people who know him will obv. know he’s undercover.

My apologies, I left out some code.

in lua/autorun/server/newfile.lua put this in:


local function undercover_table_user( ply )
  
  ply.undercover_table_user = {}
  ply.undercover_table_name = {}
  ply.undercover_table_rank = {}



end
hook.Add("PlayerInitialSpawn","undercover_table_user",undercover_table_user)

Or he could, you know…change his name?

any chance this can be into a fadmin instend of ulx ?

I think you missed the entire point, and also avoided reading the main post.

He wants this mainly as a command he can do. Read the OP next time.

I know you didn’t read the main post. He doesn’t state anywhere of him needing to change his name, which even if he does, he didn’t state anything about him needing the name change as part of the system.

Please just stop, you’re hurting yourself.

Ideally you would use Player:SetUserGroup( “user” ) while still retaining their full admin abilities.

All the built in functions (GetUserGroup(), IsUserGroup()) clientside use the networked string “UserGroup”, so other players would see that you are a user.

I don’t think you’ll be able to do this without an admin mod being created around this idea.


Shameless ad but my admin mod, “anus” actually is based around the entire premise that only other admins know who’s admin, unless a group or individual player has permission to view usergroups.

Should note though that a new update is coming soon and will be feature rich.