bartje01 Posted March 5, 2011 Posted March 5, 2011 Hey guys, I'm making a /namecolor command so people can set their name color. I've followed instructions from the wiki here. function nametagColorChange ( thePlayer, commandName, r, g, b ) setPlayerNametagColor ( thePlayer, r, g, b ) outputChatBox("HINT:/namecolor [Colorid 0-250]") end addCommandHandler ( "namecolor", nametagColorChange) WARNING: race\race_server.lua:1431: Bad argument @ 'setPlayerNametagColor' It sends me the message: Hint:/namecolor [colorid 0-250] So I know it must be something with this line setPlayerNametagColor ( thePlayer, r, g, b ) So what could it be? Thanks
Castillo Posted March 5, 2011 Posted March 5, 2011 function nametagColorChange ( thePlayer, commandName, r, g, b ) setPlayerNametagColor ( thePlayer, tonumber(r), tonumber(g), tonumber(b) ) outputChatBox("HINT:/namecolor [Colorid 0-250]") end addCommandHandler ( "namecolor", nametagColorChange) Try that.
bartje01 Posted March 5, 2011 Author Posted March 5, 2011 EDIT: THe problem is that it only turns black.. I can't do another color than Black And it only works for kill list not for text box
Castillo Posted March 6, 2011 Posted March 6, 2011 Are you sure? do you insert 3 values? example: 255 0 0 = red function nametagColorChange ( thePlayer, commandName, r, g, b ) if r and g and b then setPlayerNametagColor ( thePlayer, tonumber(r), tonumber(g), tonumber(b) ) else outputChatBox("HINT:/namecolor [syntax 255 0 0]", thePlayer, 255, 100, 0) end end addCommandHandler ( "namecolor", nametagColorChange)
bartje01 Posted March 6, 2011 Author Posted March 6, 2011 Awesome it works now With your last code. But It only works in the kill list In the chat box my name is still white Can I chagne that as well? Thanks by the way PS I noticed the friend list is yours. Well it's so damn awesome
Castillo Posted March 6, 2011 Posted March 6, 2011 Uhm, i don't use the Race gamemode, so no idea how does it work.
bartje01 Posted March 6, 2011 Author Posted March 6, 2011 Well. I think it should work like other gamemodes. It's just so weird. My chat name color is white. My kill list color is colored. So weird. Maybe someone else?
bartje01 Posted March 6, 2011 Author Posted March 6, 2011 Fixed! The standard admin panel script has a white name setter or something Thanks for helping EDIT: Wups. Sorry for dubble post
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