Jump to content

Error. Help please


bartje01

Recommended Posts

Posted

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

Posted
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.

Posted

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) 

Posted

Awesome it works now :D 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 xD

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...