Sign in to follow this  
krYshuT

Hex codes

Recommended Posts

Is there any way to hide hex codes in player's names?

Nobody want it look like this:

beznzvu0.jpg

But what is odd - when you finish the race, the killmessages resource shows it without the hex code as "ESE|krYshuT". However, when i kill myself it shows as "ESE|#ff00ffkrYshuT

Share this post


Link to post

playerName = string.gsub(playerName, '#%x%x%x%x%x%x', '')

Share this post


Link to post

Well, there is this line in delay indicator resource:

delayDisplayBehind:text("+"..msToTimeStr(delayTime).." "..cps..getPlayerName(source))

I have no experience in coding, so I don't know how to make it work fine. I tried to edit it like:

delayDisplayBehind:text("+"..msToTimeStr(delayTime).." "..cps..string.gsub(playerName, '#%x%x%x%x%x%x', ''))

But it didn't work.

How it's correct?

Else in the killmessages resource I have no idea where to paste it to make it work. Can you help me with this?

Share this post


Link to post

Works perfect, thanks much.

Just one more question. Is there a way to make color text else then in the chatbox? I've got one resources which generates text elsewhere.

Share this post


Link to post

Ingame it looks like this:

beznzvuck.png

Lua file:

local messagesList = { 
    "19.11.: ESE #00ff0013:3 TPT", 
    "ingame cycling text shows here", 
    "ingame cycling text shows here", 
    "ingame cycling text shows here", 
    "ingame cycling text shows here", 
    "ingame cycling text shows here", 
  
} 
local currentMessage = 0 
  
addEventHandler("onClientPreRender", getRootElement(), 
    function() 
        local screenWidth, screenHeight = guiGetScreenSize() 
  
        -- Draw the news sticker. 
        dxDrawRectangle(screenWidth - 249, 4, 0, 20, tocolor(0, 0, 0, 192), false) 
         
        -- Draw all strings. 
        dxDrawText(messagesList[currentMessage + 1], screenWidth - 246, 6, screenWidth - 6, 16, tocolor(255, 255, 255, 255), 1, "default-bold", "center", "top", false, false, false) 
    end 
) 
  
function updateMessage() 
    if (currentMessage == 5) then 
        currentMessage = 0 
    else 
        currentMessage = currentMessage + 1 
    end 
end 
setTimer(updateMessage, 5000, 0) 

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.