Author Topic: Use LocalPlayer():SteamName() instead of Nick()  (Read 6006 times)

0 Members and 2 Guests are viewing this topic.

Offline Edned

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Use LocalPlayer():SteamName() instead of Nick()
« on: January 09, 2016, 11:05:10 AM »
Hello, I was wondering if it was possible to change the way that ULX broadcasts the chat commands and stores bans in DarkRP. For example, if someone changes their RP name it will use their RP name and not their steam name when broadcasting messages in chat such as "Admin RP Name" has Banned "Other guy's RP Name" for etc.
It's really annoying because I would rather it use the SteamNames rather than RP Names.

Thank you in advance!
« Last Edit: January 09, 2016, 11:07:06 AM by Edned »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Use LocalPlayer():SteamName() instead of Nick()
« Reply #1 on: January 09, 2016, 12:27:28 PM »
I'm fairly certain there would be no way to figure out the player's "real" name without making some kind of Steam API call. That's the danger of overriding functions like DarkRP does.
Experiencing God's grace one day at a time.

Offline Edned

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Use LocalPlayer():SteamName() instead of Nick()
« Reply #2 on: January 09, 2016, 01:03:25 PM »
There is :P
There's actually a variable with the player's SteamName in called "SteamName()".
Here is a snippet from my Scoreboard row:
Code: [Select]
fetch = function( ply ) return ply:SteamName()I was wondering if I could use SteamName() instead of Nick() for ULX somehow?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Use LocalPlayer():SteamName() instead of Nick()
« Reply #3 on: January 09, 2016, 02:23:35 PM »
EdNed, are you absolutely sure SteamName is a Gmod lua function from Gmod itself, and not another addon's (including your scoreboard??)
Though the wiki isn't always up to date, I can't find it on the Gmod Wiki.
http://wiki.garrysmod.com/index.php?title=Special%3ASearch&profile=advanced&search=SteamName

Additionally, to be honest, I believe the request you're making goes 'against' what most people want to see when commands come across the echo and logs.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Use LocalPlayer():SteamName() instead of Nick()
« Reply #4 on: January 10, 2016, 12:50:24 AM »
SteamName() is not a gmod lua function.
As far as I know, there is no way to get a Steam community name for a player without doing some fancy http fetch calls using the steam API.

Offline Edned

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Use LocalPlayer():SteamName() instead of Nick()
« Reply #5 on: January 10, 2016, 03:52:44 AM »
Sorry, I forgot to mention that it was a built-in DarkRP function; located here: http://wiki.darkrp.com/index.php/Functions/Player/Shared/SteamName

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Use LocalPlayer():SteamName() instead of Nick()
« Reply #6 on: January 11, 2016, 03:25:09 AM »
In general, we try to generalize ULX to any/all gamemodes. We rarely do something that only applies to a non-standard gamemode. Especially given the questionable choice of misrepresenting a player's name in the first place, adding this would go against many of our development principles. Sorry, but we simply cannot support something like this.
Experiencing God's grace one day at a time.