Jump to content

Set same nickname color for all


dewu

Recommended Posts

Hi guys.

Is this possible to permanently set same nickname color for all players?

Now everyone can change color by use HTML colors tag ;/

That's my script:

  
-- Global chat 
    function globalMessage(thePlayer, cmd, ...) 
        local message = table.concat ( { ... }, " " ); 
        local name = getPlayerName(thePlayer); 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
            outputChatBox("#FF0000[ADMIN]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
        else 
            outputChatBox("#FFA34F[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
        end 
    end 
    addCommandHandler("global",  globalMessage); 
      
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
        for index,player in pairs(getElementsByType("player")) do 
            bindKey(player,"x", "down", "chatbox", "global"); 
        end 
    end) 
      
      
    addEventHandler("onPlayerJoin", getRootElement(), 
        function() 
            bindKey(source, "x", "down", "chatbox", "global"); 
        end 
    ) 
  
addEventHandler("onResourceStart", resourceRoot, 
    function() 
    setGameType ("DayZ") 
    end 
) 
  

Link to comment
  
function removeHex(oNick, nNick) 
       local n = getPlayerName(source) 
        if nNick then 
               n = nNick 
        end 
         if n:find("#%x%x%x%x%x%x") then 
               local n = n:gsub("#%x%x%x%x%x%x", "") 
               if n:len> 0 then 
                      setPlayerName(source, n) 
               else 
                      setPlayerName(source, "Player:"..math.random(100)) 
               end 
           if nNick then 
                cancelEvent() 
end 
end 
end 
addEventHandler('onPlayerChangeNick', root, removeHex) 
-- attach this function also when the player join it wil work 
  
  

Link to comment

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