ULX

Author Topic: ULX Nickname  (Read 3977 times)

0 Members and 1 Guest are viewing this topic.

Offline Saucey

  • Newbie
  • *
  • Posts: 12
  • Karma: -2
  • | OHQ Team | GCinema |
    • GCinema
ULX Nickname
« on: July 10, 2014, 10:46:08 AM »
I have had a couple people try to set up a command for me and it just doesn't seem to work.  I have been itching for a nickname system to be implemented on my servers. For instance, I want to be able to nickname myself when I am on my own servers to whatever I please.

example:

My name is "Hej" I could type !nickname Hej "server owner"

My name would now be "server owner" although my steam name would still be Hej.

I would like to see if this can be done and put into a ulx command.
Quote
Two possibilities exist...
Either we are alone in the universe or we are not.
Both are equally terrifying.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: ULX Nickname
« Reply #1 on: July 10, 2014, 05:19:36 PM »
You can do something like this, assuming most addons use Name and Nick instead of GetName

Code: [Select]
local _ply = FindMetaTable( "Player" )

function _ply:OldName()
return self:GetName()
end

function _ply:Name()
if self:GetNWString( "alt_name" ) ~= "" then
return self:GetNWString( "alt_name" )
else
return self:OldName()
end
end

function _ply:Nick()
if self:GetNWString( "alt_name" ) ~= "" then
return self:GetNWString( "alt_name" )
else
return self:OldName()
end
end


Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: ULX Nickname
« Reply #2 on: July 11, 2014, 08:42:35 AM »
Here is one that is a bit more advanced, all credits go to CapsAdmin... https://github.com/CapsAdmin/fast_addons/blob/master/lua/fast_addons/playernick.lua (May need some editing to work the way you want it to.)
I cry every time I see that I am not a respected member of this community.

Offline Saucey

  • Newbie
  • *
  • Posts: 12
  • Karma: -2
  • | OHQ Team | GCinema |
    • GCinema
Re: ULX Nickname
« Reply #3 on: July 18, 2014, 02:15:12 AM »
Okay thanks for the help, I will try and see what I can do.
Quote
Two possibilities exist...
Either we are alone in the universe or we are not.
Both are equally terrifying.

Offline Saucey

  • Newbie
  • *
  • Posts: 12
  • Karma: -2
  • | OHQ Team | GCinema |
    • GCinema
Re: ULX Nickname
« Reply #4 on: September 05, 2014, 03:24:39 AM »
Ended up just paying a coder to do it for me, took more time than expected to get this to work. I also got a ULX title command as well.
Quote
Two possibilities exist...
Either we are alone in the universe or we are not.
Both are equally terrifying.