JR10 Posted August 17, 2011 Share Posted August 17, 2011 Oh. Alright: local r, g, b = getPlayerNametagColor ( player ) local hexColor = string.format ( "#%02X%02X%02X", r, b, b ) outputChatBox ( hexColor.."golkalpfirat: #FFFFFF"..message, 0, 0, 0, true ) Link to comment
gokalpfirat Posted August 17, 2011 Author Share Posted August 17, 2011 When i use function hideJack(player,command,who,...) local targetPlayer = getPlayerFromName ( who ) local r, g, b = getPlayerNametagColor ( player ) local hexColor = string.format ( "#%02X%02X%02X", r, g, b ) if targetPlayer then local message = table.concat({...}, " ") outputChatBox(getPlayerName(targetPlayer )..""..hexcolor..":"..message ,root,255,255,255,true) end end addCommandHandler("yaziasda",hideJack) I get chat/server.lua:40 attempt to concetenate global 'hexcolor' (a nil value) Link to comment
JR10 Posted August 17, 2011 Share Posted August 17, 2011 Because it's hexColor not hexcolor function hideJack(player,command,who,...) local targetPlayer = getPlayerFromName ( who ) local r, g, b = getPlayerNametagColor ( player ) local hexColor = string.format ( "#%02X%02X%02X", r, g, b ) if targetPlayer then local message = table.concat({...}, " ") outputChatBox(getPlayerName(targetPlayer )..""..hexColor..":"..message ,root,255,255,255,true) end end addCommandHandler("yaziasda",hideJack) Link to comment
gokalpfirat Posted August 20, 2011 Author Share Posted August 20, 2011 Works but ":" is not my hex color. Link to comment
JR10 Posted August 20, 2011 Share Posted August 20, 2011 outputChatBox(hexColor..getPlayerName(targetPlayer )..": #FFFFFF"..message ,root,255,255,255,true) Link to comment
gokalpfirat Posted August 20, 2011 Author Share Posted August 20, 2011 Now works Thanks Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now