Jump to content

setNameTagColor error


ALE34

Recommended Posts

Posted (edited)

14: Bad argument @ 'setPlayerNametagColor'

"namecolormanual" works but im having problem with executeCommandHandler

function nametagColorChangeManual ( thePlayer, commandName, r, g, b ) 
    setPlayerNametagColor ( thePlayer, r, g, b ) 
end 
  
addCommandHandler ( "namecolormanual", nametagColorChangeManual ) 
  
function namecolorred ( thePlayer, commandName, ... ) 
        local red = #arg 
        local arg = { 255,0,0 } 
    executeCommandHandler ( "namecolormanual", thePlayer, red ) 
end 
  
addCommandHandler ( "namecolor-red", namecolorred ) 
  

Sorry for bad english :D

Edited by Guest
Posted

The way you did it was very untidy. I have fixed the problem, all the functions were jumbled and out of order, also you didnt have 'g' and 'b' defined in the 'nametagColorChangeManual' function.

New Code:

function nametagColorChangeManual ( thePlayer, commandName, r, g, b ) 
    setPlayerNametagColor ( thePlayer, r, g, b ) 
end 
addCommandHandler ( "namecolormanual", nametagColorChangeManual ) 
  
function namecolorred ( thePlayer ) 
    local arg = { 255,0,0 } 
    executeCommandHandler ( "namecolormanual", thePlayer,  arg[1], arg[2], arg[3]) 
end 
addCommandHandler ( "namecolor-red", namecolorred ) 

Posted
The way you did it was very untidy. I have fixed the problem, all the functions were jumbled and out of order, also you didnt have 'g' and 'b' defined in the 'nametagColorChangeManual' function.

New Code:

function nametagColorChangeManual ( thePlayer, commandName, r, g, b ) 
    setPlayerNametagColor ( thePlayer, r, g, b ) 
end 
addCommandHandler ( "namecolormanual", nametagColorChangeManual ) 
  
function namecolorred ( thePlayer ) 
    local arg = { 255,0,0 } 
    executeCommandHandler ( "namecolormanual", thePlayer,  arg[1], arg[2], arg[3]) 
end 
addCommandHandler ( "namecolor-red", namecolorred ) 

When testing still same problem :/

Posted
function nametagColorChangeManual ( thePlayer, commandName, r, g, b ) 
    setPlayerNametagColor ( thePlayer, r, g, b ) 
end 
addCommandHandler ( "namecolormanual", nametagColorChangeManual ) 
  
function namecolorred ( thePlayer ) 
    executeCommandHandler ( "namecolormanual", thePlayer, 255, 0, 0 ) 
end 
addCommandHandler ( "namecolor-red", namecolorred ) 

Posted
function nametagColorChangeManual ( thePlayer, commandName, r, g, b ) 
    setPlayerNametagColor ( thePlayer, r, g, b ) 
end 
addCommandHandler ( "namecolormanual", nametagColorChangeManual ) 
  
function namecolorred ( thePlayer ) 
    executeCommandHandler ( "namecolormanual", thePlayer, 255, 0, 0 ) 
end 
addCommandHandler ( "namecolor-red", namecolorred ) 

doesnt work... :/

Posted

server, but my friend solved the problem:DDD i tried this one before but "function namered ( thePlayer, r, g, b )"

function namered ( thePlayer ) 
       setPlayerNametagColor ( thePlayer, 255, 0, 0 ) 
end 
addCommandHandler ("red", namered ) -- Fixed by sande. 

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