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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

What gamemode are you running?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Uhm, i don't use the Race gamemode, so no idea how does it work.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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