-.Paradox.- Posted June 14, 2014 Share Posted June 14, 2014 Like that addEventHandler('onPlayerChat', getRootElement(), function(msg, type) if type == 2 then cancelEvent() local r, g, b = getPlayerNametagColor(source) for placeNumber, playerData in ipairs(getPlayersInTeam(getPlayerTeam(source))) do outputChatBox("#FF0000(CLAN)"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) end end end ) function RGBToHex(red, green, blue) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then return end return string.format("#%.2X%.2X%.2X", red, green, blue) end Hmm..No. Use my first code and add to it the RGBToHex code. Link to comment
ZeyadGTX Posted June 14, 2014 Author Share Posted June 14, 2014 But your first code you deleted it Link to comment
Et-win Posted June 14, 2014 Share Posted June 14, 2014 Yes, like that. Now put it in your function where you want to have the color. Link to comment
-.Paradox.- Posted June 14, 2014 Share Posted June 14, 2014 i need ready made please because i tried every thing local function onplayerChat ( message, messageType ) if ( messageType == 2 ) then cancelEvent ( ) local name = getPlayerName ( source ) local red, green, blue = getPlayerNametagColor ( source ) local hex = RGBToHex ( red, green, blue ) local members = getPlayersInTeam( team ) or {} for _, player in ipairs(members) do outputChatBox( "#FFFFFF(CLAN)" .. hex.." "..name .. ":#FFFFFF" .. message, player, 255, 255, 255, true ) end outputServerLog( "(TEAM): " .. name .. ": " .. message ) end end addEventHandler ( "onPlayerChat", root, onplayerChat ) For you Nikolai itsnot Working at all its not showing any thing , i mean itsnot showing (CLAN) OR (TEAM) it makes space in outputChatBox Heeeeeeeeeeeelp Then what the hell is this code? huh Link to comment
ZeyadGTX Posted June 14, 2014 Author Share Posted June 14, 2014 like that ??? local function onplayerChat ( message, messageType ) if ( messageType == 2 ) then cancelEvent ( ) local name = getPlayerName ( source ) local red, green, blue = getPlayerNametagColor ( source ) local hex = RGBToHex ( red, green, blue ) local members = getPlayersInTeam( team ) or {} for _, player in ipairs(members) do outputChatBox("#00FF00(CLAN)"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) end outputServerLog( "(TEAM): " .. name .. ": " .. message ) end end addEventHandler ( "onPlayerChat", root, onplayerChat ) function RGBToHex(red, green, blue) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then return nil end return string.format("#%.2X%.2X%.2X", red, green, blue) end Link to comment
ZeyadGTX Posted June 14, 2014 Author Share Posted June 14, 2014 Same Problem please help me i started to hate MTA because this script Link to comment
Et-win Posted June 14, 2014 Share Posted June 14, 2014 Same Problem please help me i started to hate MTA because this script If you simply let his outputChatBox in, then it did work. Link to comment
ZeyadGTX Posted June 14, 2014 Author Share Posted June 14, 2014 What Do you mean like that ? outputChatBox("#00FF00(CLAN)..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) Link to comment
Et-win Posted June 14, 2014 Share Posted June 14, 2014 outputChatBox( "#FFFFFF(CLAN)" .. hex.." "..name .. ":#FFFFFF" .. message, player, 255, 255, 255, true ) His, not mine. Link to comment
ZeyadGTX Posted June 14, 2014 Author Share Posted June 14, 2014 can't you give me the full script ? Link to comment
-.Paradox.- Posted June 14, 2014 Share Posted June 14, 2014 outputChatBox( "#FFFFFF(CLAN)" .. hex.." "..name .. ":#FFFFFF" .. message, player, 255, 255, 255, true ) His, not mine. Didn't notice it, I was on phone.. Link to comment
-.Paradox.- Posted June 14, 2014 Share Posted June 14, 2014 (edited) If it didn't worked, don't expect from me to help you again.. Removed Edited June 14, 2014 by Guest Link to comment
ZeyadGTX Posted June 14, 2014 Author Share Posted June 14, 2014 Oh finally Thanks ET-Win , Nikolai96 you are the best 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