krYshuT Posted November 27, 2010 Posted November 27, 2010 Is there any way to hide hex codes in player's names? Nobody want it look like this: 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
Aibo Posted November 27, 2010 Posted November 27, 2010 playerName = string.gsub(playerName, '#%x%x%x%x%x%x', '')
dzek (varez) Posted November 27, 2010 Posted November 27, 2010 you will have to edit every resource that is displaying it "wrong"
krYshuT Posted November 27, 2010 Author Posted November 27, 2010 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?
dzek (varez) Posted November 27, 2010 Posted November 27, 2010 delayDisplayBehind:text("+"..msToTimeStr(delayTime).." "..cps..string.gsub(getPlayerName(source), '#%x%x%x%x%x%x', ''))
krYshuT Posted November 27, 2010 Author Posted November 27, 2010 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.
dzek (varez) Posted November 27, 2010 Posted November 27, 2010 depends of the way the text is displayed.
krYshuT Posted November 27, 2010 Author Posted November 27, 2010 Ingame it looks like this: 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)
krYshuT Posted November 27, 2010 Author Posted November 27, 2010 Thanks varez, it took me like 2 hours to make it working, but it works
dzek (varez) Posted November 27, 2010 Posted November 27, 2010 your welcome, it's nice of you that you actually tried
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