dewu Posted September 15, 2014 Posted September 15, 2014 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 )
dewu Posted September 15, 2014 Author Posted September 15, 2014 You understand i see.. I mean now everyone can change his nickname color by use ex. #FFFFFF code before nickname. I want to disable this function, and also set #00FF00 color for all.
darhal Posted September 15, 2014 Posted September 15, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now