DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • July 26, 2017, 03:50:12 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: How Do I Grab A Player Name Without ANY Title Info??  (Read 271 times)
0 Members and 1 Guest are viewing this topic.
TGTarheel
Militia
**
Offline Offline

Posts: 81


View Profile
« on: June 08, 2017, 06:28:32 AM »

UPDATE: NEVER MIND...figured this one out by myself...see the answer below in case anyone else has this question!!

Is there a way?

If you cal for $session['user']['name'] - you get back a name with titke prepended (if they have a custome tite you get the name and custom title of course...

Now, I know you can call for $session['user']['login'] - but what cmes back then, is a name only - with no color codes if the player has set any.  And if they ever changed their name, it does not change the login  What I am trying to find is...where in the database is ONLY the name (with color codes) stored, and how does one call for that?

I am coding a module where I am allowing my players to have various people in the to be named after the...but I want to pull ONLY the name, with color codes, and with NO titke info whatsoever.

Is there a way to do this...and if so, how?

Not the end of the world if it can't be done, it just looks a little strange if a player encounters their own self...I wanted to come up with a way where, for those players, the name would come uo something else, so that they do not appear to e talking to themselves.

As I mentioned, I coud cal for login...but that is not relliable as one can change name without changing login...and as login contains no color-code info.

THE ANSWER:

require_once("lib/names.php"); (put this in your run function at the top)

NOW, when you want to get the players BASENAME ( this is their name, with color codes and without any title info)

$plyrname = get_player_basename();

IT WORKS!!!
« Last Edit: June 08, 2017, 06:42:02 AM by TGTarheel » Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1758


You're welcome.


View Profile WWW
« Reply #1 on: June 08, 2017, 07:43:37 AM »

THE ANSWER:

require_once("lib/names.php"); (put this in your run function at the top)

NOW, when you want to get the players BASENAME ( this is their name, with color codes and without any title info)

$plyrname = get_player_basename();

IT WORKS!!!

That's if you want to get the base name of the logged-in player only. If you want to get the base name of another player other than the logged-in one (e.g. making a list of multiple players), use the same function, but pass an array into it with the other player's name, title and custom title(/ctitle).
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
19 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search