Karuzo Posted December 25, 2013 Posted December 25, 2013 Hi Community, i have a problem , i used Ruga's Advertisement Script . But i dont wan't that color codes in the Advertisement , how to get rid of them ? Script : function Advertisment(thePlayer, commandName, ...) local players = getElementsByType("player") local playerName = getPlayerName ( thePlayer ) local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "[[AD FROM - " .. playerName.. "]] " ..table.concat ( chatContent, " "), player, 0, 255, 0) end end addCommandHandler( "ad", Advertisment )
Dealman Posted December 26, 2013 Posted December 26, 2013 By using gsub. function Advertisment(thePlayer, commandName, ...) local players = getElementsByType("player") local playerName = getPlayerName ( thePlayer ) local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "[[AD FROM - " .. playerName:gsub("#%x%x%x%x%x%x","").. "]] " ..table.concat ( chatContent, " "), player, 0, 255, 0) end end addCommandHandler( "ad", Advertisment ) If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
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