ULX

Author Topic: Fakename - Go Undercover!  (Read 22918 times)

0 Members and 1 Guest are viewing this topic.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Fakename - Go Undercover!
« on: April 14, 2015, 06:31:22 AM »
Fakename

What does this do?
This is a small module for ULX that will hide your name and uteam from the public eye.  This would let you go undercover to watch people do things they originally would not do with you present.  Commonly could be used to watch rule breakers quietly or to watch staff members and how they behave without you.

I do not and will not go into huge depths with this module as there are too many circumstances to consider.  Anything you wish to do beyond the basics, you will have to work on yourself.

What this doesn't do?
 - Hide your steamid in the status command
 - Hide your group in the ulx who command
 - Hide your avatar
 - Hide your name when using chatbox

Commands
ulx fakename <fake name> <group>
ulx unfakename

Download
https://github.com/Aaron113/fakename

Additional Downloads
Download TTT name change fix - Place file in fakename/lua/ulx/modules/
« Last Edit: June 07, 2015, 11:51:52 AM by Aaron113 »

Offline allofmywutsteam

  • Full Member
  • ***
  • Posts: 136
  • Karma: 3
  • MNWO Owner
    • MNWO Discord
Re: UFakename - Go Undercover!
« Reply #1 on: April 14, 2015, 08:36:13 AM »
So it makes your line on the Scoreboard blank, but leaves the avatar? Have any screencaps?
"Then Jesus said to his disciples, 'Whoever wants to be my disciple must deny themselves and take up their cross and follow me.'" - Matthew 16:24



MNWO: Steam | Discord | Website | Join Server

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: UFakename - Go Undercover!
« Reply #2 on: April 14, 2015, 03:15:16 PM »
It changes your name without actually requiring you to change your name.  It kind of changes your rank, but without modifying ULib, it's impossible to fully hide your rank.  I'll put some more effort into the post in a bit.

The commands are:
ulx fakename <name> <group>
ulx unfakename

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Fakename - Go Undercover!
« Reply #3 on: April 14, 2015, 08:20:19 PM »
Just so everyone is aware, it has been renamed to just "Fakename".  You can either redownload it with the new URL or relocate your repository.  I will stick a bit more effort into this addon, but I'm trying to keep it pretty basic.

Offline Marmigamed

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Fakename - Go Undercover!
« Reply #4 on: April 18, 2015, 12:54:20 PM »
Great job

Offline Zoeo

  • Newbie
  • *
  • Posts: 15
  • Karma: 1
Re: Fakename - Go Undercover!
« Reply #5 on: April 19, 2015, 07:38:04 AM »
It works but I seem to be getting an annoying error:
Code: [Select]
[ERROR] addons/fakename/lua/ulx/modules/sh/sh_fakename.lua:31: attempt to call field 'UTeamSpawnAuth' (a nil value)
1. SetFakegroup - addons/fakename/lua/ulx/modules/sh/sh_fakename.lua:31
2. call - addons/fakename/lua/ulx/modules/sh/sh_fakename.lua:68
3. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
4. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
5. Run - lua/includes/modules/concommand.lua:54
6. unknown - addons/ulib/lua/ulib/shared/commands.lua:1310
7. unknown - lua/includes/modules/concommand.lua:54

Using your latest version of the code, it will also not allow me to change my name to another fake name or unfakename myself.
It is also not compatible with TTT - Easyscoreboard (in the sense of changing ranks on the scoreboard)

EDIT:It also literally puts you into the group you specify and restricts your commands to that group, even though it looks like you have access to those commands.
And for some reason when I put the command in it's own file (I previously had it in a file with other commands) it takes away the ability to use the drop down to select your group.
« Last Edit: April 19, 2015, 07:51:44 AM by Zoeo »

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Fakename - Go Undercover!
« Reply #6 on: April 19, 2015, 03:03:11 PM »
It works but I seem to be getting an annoying error:
Code: [Select]
[ERROR] addons/fakename/lua/ulx/modules/sh/sh_fakename.lua:31: attempt to call field 'UTeamSpawnAuth' (a nil value)
1. SetFakegroup - addons/fakename/lua/ulx/modules/sh/sh_fakename.lua:31
2. call - addons/fakename/lua/ulx/modules/sh/sh_fakename.lua:68
3. __fn - addons/ulib/lua/ulib/shared/commands.lua:943
4. unknown - addons/ulib/lua/ulib/shared/commands.lua:1296
5. Run - lua/includes/modules/concommand.lua:54
6. unknown - addons/ulib/lua/ulib/shared/commands.lua:1310
7. unknown - lua/includes/modules/concommand.lua:54
Fixed in 0e89afac.

Using your latest version of the code, it will also not allow me to change my name to another fake name or unfakename myself.
I do not have this problem, elaborate?

It is also not compatible with TTT - Easyscoreboard (in the sense of changing ranks on the scoreboard)
As I said many times, I am keeping this addon basic.  It is your job to make it compatible, which isn't hard at all.

EDIT:It also literally puts you into the group you specify and restricts your commands to that group, even though it looks like you have access to those commands.
This sounds like an old version where I literally replaced the group function.  Have you updated recently and/or relocated your repository to the latest url?

And for some reason when I put the command in it's own file (I previously had it in a file with other commands) it takes away the ability to use the drop down to select your group.
I will have to investigate this one.  I seem to be having the same issue with group completes not always showing.  I'm sure they did at some point.  Perhaps some assistance from the Ulysses team?
« Last Edit: April 19, 2015, 03:06:31 PM by Aaron113 »

Offline Zoeo

  • Newbie
  • *
  • Posts: 15
  • Karma: 1
Re: Fakename - Go Undercover!
« Reply #7 on: April 19, 2015, 04:43:57 PM »
Fixed in 0e89afac.
Sweet.

I do not have this problem, elaborate?
It was fixed in the recent update.

As I said many times, I am keeping this addon basic.  It is your job to make it compatible, which isn't hard at all.
I shall try to do that if I can.

This sounds like an old version where I literally replaced the group function.  Have you updated recently and/or relocated your repository to the latest url?
Fixed and added.


Offline McSniper121

  • Newbie
  • *
  • Posts: 9
  • Karma: 1
Re: Fakename - Go Undercover!
« Reply #8 on: April 22, 2015, 07:00:30 AM »
I don't seem to understand how this works. Does it hide your name and group in any scoreboard script?
GTA 5 Online and DarkRP is life

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Fakename - Go Undercover!
« Reply #9 on: April 22, 2015, 09:51:45 AM »
I don't seem to understand how this works. Does it hide your name and group in any scoreboard script?
It will hide your name from the scoreboard and anywhere else other than the default chatbox (it must use some engine name method or something).  It will hide your team from any scoreboard that uses UTeam, but if it doesn't use UTeam, you will have to modify it to work with this addon.  For example, that scoreboard mentioned above seems to use IsAdmin and IsSuperAdmin for rank setting (didn't look thoroughly).  To fix it, you would have to use one of the functions I built into this addon such as Player:GetFakegroup().

To make this addon flawless, I would have to consider too many different scenarios.  This is completely unrealistic for me as a developer.  So, your job as a server owner, is to make it compatible with what addons you wish.  The server that I worked with had everything custom coded without a single addon.  All 100% their/my code.  This made it easy because you can just change everything to work with the fakename.  Without modifying every release to work with my addon, it will never work with everything unless you make it.

This is mostly being considerate of ULib's ranks.  I can't change what group the server sees you as without completely removing all your access as well.

Offline McSniper121

  • Newbie
  • *
  • Posts: 9
  • Karma: 1
Re: Fakename - Go Undercover!
« Reply #10 on: April 22, 2015, 09:57:38 AM »
It will hide your name from the scoreboard and anywhere else other than the default chatbox (it must use some engine name method or something).  It will hide your team from any scoreboard that uses UTeam, but if it doesn't use UTeam, you will have to modify it to work with this addon.  For example, that scoreboard mentioned above seems to use IsAdmin and IsSuperAdmin for rank setting (didn't look thoroughly).  To fix it, you would have to use one of the functions I built into this addon such as Player:GetFakegroup().

To make this addon flawless, I would have to consider too many different scenarios.  This is completely unrealistic for me as a developer.  So, your job as a server owner, is to make it compatible with what addons you wish.  The server that I worked with had everything custom coded without a single addon.  All 100% their/my code.  This made it easy because you can just change everything to work with the fakename.  Without modifying every release to work with my addon, it will never work with everything unless you make it.

This is mostly being considerate of ULib's ranks.  I can't change what group the server sees you as without completely removing all your access as well.

Awesome thanks!
GTA 5 Online and DarkRP is life

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Fakename - Go Undercover!
« Reply #11 on: April 23, 2015, 10:07:35 PM »
Include meta:Name() too. That'll most likely fix that TTT problem.

Edit: Here's a reference: https://github.com/NekuMitsurugi/Simple-Nickname-Functions/blob/master/lua/autorun/neko_nickname_sh.lua
« Last Edit: April 23, 2015, 10:11:09 PM by Neku »
Out of the Garry's Mod business.

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Fakename - Go Undercover!
« Reply #12 on: April 23, 2015, 10:46:20 PM »
Include meta:Name() too. That'll most likely fix that TTT problem.

Edit: Here's a reference: https://github.com/NekuMitsurugi/Simple-Nickname-Functions/blob/master/lua/autorun/neko_nickname_sh.lua
Ohhh, I got you.  Name just points to the Nick function... For some reason, I thought replacing Nick would also make Name point to the new function.  I should have realized that, I just wasn't thinking.  I'll fix it tomorrow.
« Last Edit: April 23, 2015, 10:47:58 PM by Aaron113 »

Offline Zoeo

  • Newbie
  • *
  • Posts: 15
  • Karma: 1
Re: Fakename - Go Undercover!
« Reply #13 on: May 02, 2015, 07:43:35 PM »
Include meta:Name() too. That'll most likely fix that TTT problem.

Edit: Here's a reference: https://github.com/NekuMitsurugi/Simple-Nickname-Functions/blob/master/lua/autorun/neko_nickname_sh.lua
What TTT problem would this fix exactly?

If it's the kicking the person for changing name during round, it doesn't sadly :\

Offline Zoeo

  • Newbie
  • *
  • Posts: 15
  • Karma: 1
Re: Fakename - Go Undercover!
« Reply #14 on: May 31, 2015, 12:37:30 PM »
If anyone wants to fix the issue with not hiding your name from chat.

Find function meta:IsFakenamed() and put this below it (Not in the function, below the function):
Code: [Select]
local function AddFakeNameText( ply, text )
if ply:Alive() and not ply:IsSpec() and not ply:IsActiveDetective() then
chat.AddText( Color( 0, 200, 0 ),
ply:Nick(),
color_white,
": " .. text )
end
if ply:Alive() and ply:IsActiveDetective() then
chat.AddText( Color( 50, 200, 255 ),
ply:Nick(),
color_white,
": " .. text )
end
if ply:IsSpec() and not ply:IsDeadTerror() then
chat.AddText( Color( 24, 161, 35 ),
Format( "(%s) ", string.upper( "team" ) ),
Color( 200, 200, 0 ),
ply:Nick(),
color_white,
": " .. text )
end
if ply:IsDeadTerror() then
chat.AddText( Color( 255, 30, 40 ),
Format( "*%s* ", string.upper( "dead" ) ),
Color( 24, 161, 35 ),
Format( "(%s) ", string.upper( "team" ) ),
Color( 200, 200, 0 ),
ply:Nick(),
color_white,
": " .. text )
end
end

hook.Add( "OnPlayerChat", "Fake_Chatname", function( ply, text, teamchat, dead )
if IsValid( ply ) and ply:IsFakenamed() then
AddFakeNameText( ply, text )
return true
end
end )

Not sure if this is the best way to fix it, but it's the way I've found so far that works.  This will work but when you're a spectator it will always say (TEAM)[fake name]: [message] regardless of whether you say it in team chat or not.  Same goes for player chat it will always say [fake name]: [message] even if you use team chat (Pre round only, when you're a detective or traitor is will say what it normally says when you're unfakenamed).
« Last Edit: May 31, 2015, 12:40:20 PM by Zoeo »