Turbe$Z Posted November 27, 2016 Share Posted November 27, 2016 Hey, is there a function or something to remove the color code of me, and change RGB? Link to comment
Dzsozi (h03) Posted November 27, 2016 Share Posted November 27, 2016 (edited) 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 November 27, 2016 by Dzsozi Link to comment
Turbe$Z Posted November 27, 2016 Author Share Posted November 27, 2016 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
Dzsozi (h03) Posted November 27, 2016 Share Posted November 27, 2016 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. 1 Link to comment
Turbe$Z Posted November 27, 2016 Author Share Posted November 27, 2016 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!!! Now working fine. 1 Link to comment
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