Johnniey Posted June 6, 2011 Posted June 6, 2011 Some time ago i posted a question for a way to hide the name color codes ( /viewtopic.php?f=91&t=33198 ) But i know i want to if there's a way to USE them.. Like in killmessages and ranking (left of the screen) (off topic question, in which resource is the /me command ) Regards, John In-game name|SW|]Johnniey Leader of |SW| Mixed Party Server
Castillo Posted June 6, 2011 Posted June 6, 2011 The /me command is a built-in command, you can cancel it. addEventHandler ( "onPlayerChat", getRootElement(), function ( message, messageType ) if messageType == 1 then cancelEvent() end end) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
proracer Posted June 6, 2011 Posted June 6, 2011 Example: player = '#ffff00proracer' outputChatBox ( player:gsub ( '#%x%x%x%x%x%x', '' ) )
Johnniey Posted June 6, 2011 Author Posted June 6, 2011 The /me command is a built-in command, you can cancel it. Its not for canceling, but editing, its now pink and with the color codes, but i prefer it in our color and with working color codes getPlayerName(player):gsub('#%x%x%x%x%x%x', '') Something like this, but this line deletes the code, and i want something to get the code working^^ Possible or not? In-game name|SW|]Johnniey Leader of |SW| Mixed Party Server
Castillo Posted June 6, 2011 Posted June 6, 2011 outputChatBox function has a last argument, used color code or not, set it to true, example: outputChatBox("#FF0000Hello world.",getRootElement(),255,255,255,true) Did you meant that? And for /me with different style, do this: addEventHandler ( "onPlayerChat", getRootElement(), function ( message, messageType ) if messageType == 1 then cancelEvent() outputChatBox("* ".. getPlayerName(source) .. "".. tostring(message),getRootElement(),255,100,0) -- should output in some kind of orange colour. end end) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
karlis Posted June 6, 2011 Posted June 6, 2011 for changing colors of dx texts, for example kill tabs, you need to edit the resources but if you want to get rgb from hex, its easy local nick=getPlayerName(player) local col=nick:match("^#(%x%x%x%x%x%x)" local nick=nick:gsub("#%x%x%x%x%x%x","") local r,g,b=tonumber("0x"..string.sub(col, 1, 2)), tonumber("0x"..string.sub(col, 3, 4)), tonumber("0x"..string.sub(col, 5, 6)) [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
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