Giovany Mito Posted July 6, 2019 Posted July 6, 2019 what command do I use to leave the color of the player's name with the same team color?
HassoN Posted July 6, 2019 Posted July 6, 2019 (edited) Use getPlayerTeam getTeamColor setPlayerNametagColor Edited July 6, 2019 by HassoN * There is No God but Allah discord: HassoN#2709 Visit my wiki profile: https://wiki.multitheftauto.com/wiki/User:Hassan_saad
Giovany Mito Posted July 6, 2019 Author Posted July 6, 2019 setPlayerNametagColor ( getTeamColor ) like this ???
HassoN Posted July 6, 2019 Posted July 6, 2019 (edited) Here's an example: -- Server side function fixColors(player) -- making a function local team = getPlayerTeam(player) -- getting player's team if team then -- checking if the player is in a team local r, g, b = getTeamColor(team) -- get the team's color setPlayerNametagColor(player, r, g, b) -- set player color to his team. end -- first if end end -- function end addCommandHandler("fix", fixColors) -- command Edited July 6, 2019 by HassoN * There is No God but Allah discord: HassoN#2709 Visit my wiki profile: https://wiki.multitheftauto.com/wiki/User:Hassan_saad
eoL Shady Posted January 27, 2022 Posted January 27, 2022 (edited) hello, if your problem is still valid, I would like to leave this code here, it will be useful for you. if content then if column.name == "name" then r, g, b = getPlayerNametagColor( element ) elseif column.name == "Team" then -- content here is the rank name, set the color how you want it to be. if content == "TEAMNAME" then r = 100 g = 100 b = 255 else r = 255 g = 255 b = 255 end end end @Giovany Mito you can write on the client side of the scoreboard Edited January 27, 2022 by eoL|Shady
Guest turret001 Posted January 27, 2022 Posted January 27, 2022 12 minutes ago, eoL|Shady said: hello, if your problem is still valid, I would like to leave this code here, it will be useful for you. if content then if column.name == "name" then r, g, b = getPlayerNametagColor( element ) elseif column.name == "Team" then -- content here is the rank name, set the color how you want it to be. if content == "TEAMNAME" then r = 100 g = 100 b = 255 else r = 255 g = 255 b = 255 end end end @Giovany Mito you can write on the client side of the scoreboard Please don't bump old topics and stick to new ones.
Recommended Posts