Jump to content

HELP!


Nerses

Recommended Posts

Posted

How to make that when the man went on a server with color nick, that it was not? html code that is displayed before the nick is.

Posted

I think this is what you mean. This sets the players name red when they join the server.

function nametagColorChange ( thePlayer,  r, g, b ) 
    setPlayerNametagColor ( thePlayer, 255, 0, 0 ) 
end 
  
addEventHandler ( "onPlayerJoin", nametagColorChange ) 

Posted
I think this is what you mean. This sets the players name red when they join the server.
function nametagColorChange ( thePlayer,  r, g, b ) 
    setPlayerNametagColor ( thePlayer, 255, 0, 0 ) 
end 
  
addEventHandler ( "onPlayerJoin", nametagColorChange ) 

Well that HTML colors to avoid. And where you need it to write/edit?

Posted

You just have to put it in any server-side file.

I think this is what you mean. This sets the players name red when they join the server.
function nametagColorChange ( thePlayer,  r, g, b ) 
    setPlayerNametagColor ( thePlayer, 255, 0, 0 ) 
end 
  
addEventHandler ( "onPlayerJoin", nametagColorChange ) 

Well that HTML colors to avoid. And where you need it to write/edit?

These actually aren't HTML color codes. HTML mostly uses HEX (#ff0000, etc...) and this is RGB.

Posted
You just have to put it in any server-side file.
I think this is what you mean. This sets the players name red when they join the server.
function nametagColorChange ( thePlayer,  r, g, b ) 
    setPlayerNametagColor ( thePlayer, 255, 0, 0 ) 
end 
  
addEventHandler ( "onPlayerJoin", nametagColorChange ) 

Well that HTML colors to avoid. And where you need it to write/edit?

These actually aren't HTML color codes. HTML mostly uses HEX (#ff0000, etc...) and this is RGB.

I had in mind. I created a new lua and meta file dumped to the server and it does not work

Posted
I think this is what you mean. This sets the players name red when they join the server.
function nametagColorChange ( thePlayer,  r, g, b ) 
    setPlayerNametagColor ( thePlayer, 255, 0, 0 ) 
end 
  
addEventHandler ( "onPlayerJoin", nametagColorChange ) 

You may want to rethinking before you even try to help others with such code, you didn't attach the event to an element also this event doesn't have any parameters.

Posted
I think this is what you mean. This sets the players name red when they join the server.
function nametagColorChange ( thePlayer,  r, g, b ) 
    setPlayerNametagColor ( thePlayer, 255, 0, 0 ) 
end 
  
addEventHandler ( "onPlayerJoin", nametagColorChange ) 

You may want to rethinking before you even try to help others with such code, you didn't attach the event to an element also this event doesn't have any parameters.

help

Posted
help

Write in English so people here can understand what you're asking for, because i didn't get any shit.

Posted
help

Write in English so people here can understand what you're asking for, because i didn't get any :~.

for example a man went to #fff0f... and so on and so his nickname was white as at all and not a colour

Posted

Try using this:

addEventHandler ( "onPlayerJoin", root, function ( ) 
    updatePlayerNick ( source, getPlayerName ( source ) ) 
end ) 
  
addEventHandler ( "onClientPlayerChangeNick", root, function ( _, new ) 
    updatePlayerNick ( source, new ) 
end ) 
  
  
function updatePlayerNick ( source, n ) 
    local n = tostring ( n ):gsub ( " #%x%x%x%x%x%x", "" ) 
    if ( n == "" ) then 
        n = "User"..math.random(50) 
    end 
    setPlayerName ( source, n ) 
end 

Posted
Try using this:
addEventHandler ( "onPlayerJoin", root, function ( ) 
    updatePlayerNick ( source, getPlayerName ( source ) ) 
end ) 
  
addEventHandler ( "onClientPlayerChangeNick", root, function ( _, new ) 
    updatePlayerNick ( source, new ) 
end ) 
  
  
function updatePlayerNick ( source, n ) 
    local n = tostring ( n ):gsub ( " #%x%x%x%x%x%x", "" ) 
    if ( n == "" ) then 
        n = "User"..math.random(50) 
    end 
    setPlayerName ( source, n ) 
end 

where you want it all to write? or instead of what

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