Jump to content

Can i remove color coding and change RGB in /me?


Turbe$Z

Recommended Posts

You can do your own /me command.

function customMeCommand(message, messageType)
	local playerName = getPlayerName(source)
	local message = string.gsub(message, "#%x%x%x%x%x%x", "")
	if not isPedDead(source) and then
    		if messageType == 1 then
      			cancelEvent()
			outputChatBox("** " .. playerName .. " " .. message .. "", getRootElement(), 192, 162, 216, true)
		end
	end
end
addEventHandler("onPlayerChat", getRootElement(), customMeCommand)

 

Edited by Dzsozi
Link to comment
4 minutes ago, Dzsozi said:

You can do your own /me command.


function customMeCommand(message, messageType)
	local playerName = getPlayerName(source)
	local message = string.gsub(message, "#%x%x%x%x%x%x", "")
	if not isPedDead(source) and then
    		if messageType == 1 then
      			cancelEvent()
			outputChatBox("** " .. playerName .. " " .. message .. "", getRootElement(), 192, 162, 216, true)
		end
	end
end
addEventHandler("onPlayerChat", getRootElement(), customMeCommand)

 

server.lua:4: unexpected symbol near 'then', why?

Link to comment

Oh sorry, I made a typo, there was an "and" before the "then".

function customMeCommand(message, messageType)
	local playerName = getPlayerName(source)
	local message = string.gsub(message, "#%x%x%x%x%x%x", "")
	if not isPedDead(source) then
    		if messageType == 1 then
      			cancelEvent()
			outputChatBox("** " .. playerName .. " " .. message .. "", getRootElement(), 192, 162, 216, true)
		end
	end
end
addEventHandler("onPlayerChat", getRootElement(), customMeCommand)

Try now please.

  • Like 1
Link to comment
1 minute ago, Dzsozi said:

Oh sorry, I made a typo, there was an "and" before the "then".


function customMeCommand(message, messageType)
	local playerName = getPlayerName(source)
	local message = string.gsub(message, "#%x%x%x%x%x%x", "")
	if not isPedDead(source) then
    		if messageType == 1 then
      			cancelEvent()
			outputChatBox("** " .. playerName .. " " .. message .. "", getRootElement(), 192, 162, 216, true)
		end
	end
end
addEventHandler("onPlayerChat", getRootElement(), customMeCommand)

Try now please.

Thank you!!! :D Now working fine. :D

  • Like 1
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...