Jump to content

Remove HEX of Chat Windows


BorderLine

Recommended Posts

Hi comunity.

Well im a new user in forum.

and i decide register because i learn much reading the forum's post. In special solidnake and JR10 you helpme so much

Well i have a problem, i dont know if this is good or not.

I want remove hex code from pm chat window

 function removeHEXFromString(str) 
return str:gsub("#%x%x%x%x%x%x", "") 
end 

i dont know if i need put some "IF" or other fuction :S

I maked much changes, but i cant doit :S

and sorry for my english..

i hope you can understan what i need

here i have a img

62886166.png

Thanks :)

Link to comment

maybe..

  
-- remove color coding from string 
function removeColorCoding (name) 
    return type(name)=="string" and string.gsub(name, "#%x%x%x%x%x%x", "") or name 
end 
  
-- getPlayerName with color coding removed 
local _getPlayerName = getPlayerName 
function getPlayerName(player) 
    if type(player) == "string" then 
        return removeColorCoding(player) 
    end 
    return removeColorCoding (_getPlayerName(player)) 
end 

Link to comment
maybe..
  
-- remove color coding from string 
function removeColorCoding (name) 
    return type(name)=="string" and string.gsub(name, "#%x%x%x%x%x%x", "") or name 
end 
  
-- getPlayerName with color coding removed 
local _getPlayerName = getPlayerName 
function getPlayerName(player) 
    if type(player) == "string" then 
        return removeColorCoding(player) 
    end 
    return removeColorCoding (_getPlayerName(player)) 
end 

aaaaaah you are the best man :D

now is fix

thanks alot..!!!!

if some mod read this can be closed this post :D all are okey :D

Link to comment

Just didnt understood a thing...

  
return type(name)=="string" and string.gsub(name, "#%x%x%x%x%x%x", "") or name -- what is this? is like "if" structure? how this works in lua scripting? 
  
... 
  
local _getPlayerName = getPlayerName -- this is a hook of getPlayerName? how this works? its to dosent call the costum function  below? 
function getPlayerName(player) -- we can make a function with a native MTA one? 
  

Thanks in advance :)

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