Author Topic: player.ColouredName  (Read 1605 times)

JamesConway

  • Newbie
  • *
  • Posts: 39
  • Karma: +9/-3
    • View Profile
player.ColouredName
« on: February 03, 2016, 08:54:18 pm »
Hello guys,

I can't seem to set the colour of a players name. This is what I have tried:

Code: [Select]
player.ColouredName = "[#E5FFCC]hi[#d]";
Code: [Select]
player.ColouredName = "[#E5FFCC]hi";
The wiki says to use:

"You can use the colour formatting tags with this function ([#RRGGBB] [#d])"

But there is no clear example of how to use it. Does someone know how to use this?

Theremin

  • Full Member
  • ***
  • Posts: 154
  • Karma: +48/-18
  • Worst Server Owner
    • View Profile
    • Visit my YouTube channel
Re: player.ColouredName
« Reply #1 on: February 06, 2016, 06:20:51 pm »
I decided to give it a try and nothing, I can change the name but not the colour, I might guess that the colour is overridden by the Player.Colour settings in context.xml, but it's just my supposition, yet still some servers allow changing nickname colours so... I'm looking forward to an example of usage either.

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: player.ColouredName
« Reply #2 on: February 08, 2016, 05:01:31 am »
Code: [Select]
player.ColouredName =  player.Name + " [#0000ff][TEST]";
Code: [Select]
player.ColouredName =  player.Name + " [#0000ff][YouMad?]";
Code: [Select]
player.ColouredName =  player.Name + " [#0000ff][NOOB]";
Also

Code: [Select]
player.ColouredName =  "[#0000ff]" + player.Name;
works for a good replacement on player.nametagcolour

Both of you wanted this i know theremin has.. You are both welcome

Now back to my position database,.

 ;D

BTW,,.. This seems to only work after a second player + the rest joins the original seems to go to default, probable need some type of
Code: [Select]
GetMaxPlayers
Also Theremin is right about colors is the content.xml ,. I deleted and it helped.

If the two of you and myself would like to get together a make this an actual function that you call back on player spawn I would be more than happy to. We could have full control over player.nametage colour using
Code: [Select]
player.ColouredName =  "[#0000ff]" + player.Name;
should create a new forum seeking help on bypassing the function
Code: [Select]
player.nametagcolour More than likely got broken on some update

Theremin

  • Full Member
  • ***
  • Posts: 154
  • Karma: +48/-18
  • Worst Server Owner
    • View Profile
    • Visit my YouTube channel
Re: player.ColouredName
« Reply #3 on: February 08, 2016, 04:24:31 pm »
Also Theremin is right about colors is the content.xml ,. I deleted and it helped.
Thanks a lot Motley! This is the reply I was waiting for :)

We could have full control over player.nametage colour using
Code: [Select]
player.ColouredName =  "[#0000ff]" + player.Name;
I don't think there is any way of bypassing the broken Player.NametagColour since that function is supposed to change the player tag on screen, the one you actually see in game which is always white as default, while the Player.ColouredName, just changes the player name colour, the one which is shown in chat and in the scoreboard. How can the last code you posted change the tag colour?

EDIT: I was wrong here, my bad :P
« Last Edit: February 08, 2016, 05:35:48 pm by Theremin »

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: player.ColouredName
« Reply #4 on: February 08, 2016, 04:51:52 pm »
?Im confused. I don't have game tags just a health bar and armour bar. very strange i thought the game had them but obviously they do. i don't know what is wrong with my liberty unleashed.


I Appologies really i do.
I thought you were referring to overriding the players name color not the box.


Theremin

  • Full Member
  • ***
  • Posts: 154
  • Karma: +48/-18
  • Worst Server Owner
    • View Profile
    • Visit my YouTube channel
Re: player.ColouredName
« Reply #5 on: February 08, 2016, 05:33:49 pm »
WAIT! I just went on doing more tests and here is what I got: When a player chooses his nickname, the color is applied both to the nickname and nametag, If I set his colors with Player.ColouredName, it won't show to other players until they /reconnect (I just tested this with more instances opened). So basically I was wrong, but thank you Motley cause you had me doubtful with your last post and I went on to test more stuff. So basically Player.NametagColour isn't needed, because Player.ColouredName already sets the colors for both nickname and nametag as well. The only possible case when you may want to use it, is when you want to set different nametag colours then nickname colours. Last but not least, Motley you have my apologies as well for my last post, since I was wrong ;D

EDIT: I read again your first post, and noticed you were always right, just I didn't understand it well when I first read it, now I do
« Last Edit: February 08, 2016, 05:39:41 pm by Theremin »

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: player.ColouredName
« Reply #6 on: February 08, 2016, 07:28:35 pm »
My apologies as well. I had just woke up and responded right away (on a touch screen). I had the same issue with Player.ColouredName only changing the name. This can be fun to set a timer if player.Name = Theremin on players spawn set name to "something blank". and If player isn't logged on spawn Kick player. But I had to register again on player death( name equaled new name. still can be fun to be hidden.

Also I really thought that the nametags had a rectangle gui interface?? But realized they don't. Maybe I am thinking of MTA?

Also you are welcome. I got tempted to play with this after realizing it has to be color then name(LOL). I tried + player.Health for fun instead of + player.Name but the name changes into numbers since it only deals with the players name.

And yes the reconnect part is strange. I noticed that somehow the default color is set. In my case white. If that can be changed + having say maybe 15 different colors to call from with the code rand()  which equals random.

Example: in juppis PNS script it has this function for many random colors to be applied.

Code: [Select]
player.Vehicle.RGBColour1 = Colour( rand() % 256, rand() % 256, rand() % 256 );
player.Vehicle.RGBColour2 = Colour( rand() % 256, rand() % 256, rand() % 256 );

Seems interesting but I am just happy to see this function bypassed and working as well as seeing Player.ColouredName works with adding name's. This would be good for killers on spheres. or cheaters. maybe on player connect getting certain luid and manually set a added name. or Finding there original name and on spawn changing the name back over to the original registered name.

If you don't have a login system or hashes. setting names with the error of not adding + player.Name with the rand() idea I listed you could have a lot of funny random guest names

I hope to see someone add onto Player. ColouredName functions or learning other functions that are close..

Maybe this is how it was supposed to be done and a tester or whom ever said ahh player.nametagcolour,
I noticed that a lot of the wiki in general is extremely morbid. And lacks proper coding,


No offence to Lu Staff i Respect the Staff,

EDIT-- didnt want to personal message
Btw i think both of you were trying to find out how to change the weather in content.xml

I know theremin and Sven was That code would be

Code: [Select]
weatherlock 0
weatherupdatetime 100

i find 100 to be good. i haven't found the time to time the single-player weather changes to get a good enough time.

Figured i'd put that out there as well  ;D

*More fun in this post*
« Last Edit: February 08, 2016, 08:18:34 pm by Motley »

 

© Liberty Unleashed Team.