How change players nicknames color?

amadin
Member
 
Posts: 471
Joined: Tue Jun 16, 2015 16:23
GitHub: Amadin

How change players nicknames color?

by amadin » Sun Feb 14, 2016 16:14

Hello. How change color of players nicknames on server side? I can change source code if needed.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: How change players nicknames color?

by rubenwardy » Sun Feb 14, 2016 18:48

 

User avatar
kaadmy
Member
 
Posts: 627
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: How change players nicknames color?

by kaadmy » Sun Feb 14, 2016 18:51

What is your goal? Change the player nametag (not name, but nametag) for different players?
Changing the name's color is currently impossible, but the nametag is now changeable.

Putting this in a mod should make admins have a red nametag.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local admins = {"amadin"}

minetest.register_on_joinplayer(function(player)
  for _, n in pairs(admins) do
    if player:get_player_name() == n then
      player:set_nametag_attributes({color = "red"})
      break
    end
  end
end)
Never paint white stripes on roads near Zebra crossings.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: How change players nicknames color?

by rubenwardy » Sun Feb 14, 2016 19:03

You can change the nametag's color, so the name that floats above the head. But you can't change the chat color. I'm guessing he meant the former.
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 8 guests

cron