☠ RaZeR ☠ Posted October 10, 2014 Share Posted October 10, 2014 hi guys ihave code that replace (Team) to Gang and i have code that replace teamsay to Chat but it dosent work { when i writte on the "y" the word dosent display } bindKey(source, "y", "down", "chatbox", "FOY.Chat") 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("#00FF00|FOY Chat| :"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) end end end) Link to comment
Banex Posted October 10, 2014 Share Posted October 10, 2014 addEventHandler("onPlayerChat", root, function(msg, messageType) if messageType == 2 then cancelEvent() local team = getPlayerTeam(source) local r, g, b = getPlayerNametagColor(source) for _, member in ipairs( getPlayersInTeam(team) ) do outputChatBox('#00FF00|FOY Chat| :' .. getPlayerName(source) .. ': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), member, r, g, b, true) end end end) Link to comment
☠ RaZeR ☠ Posted October 10, 2014 Author Share Posted October 10, 2014 OK : BUT Iwant to change Teamsay Bind "y" bindKey(source, "y", "down", "chatbox", "FOY.Chat") Link to comment
Banex Posted October 10, 2014 Share Posted October 10, 2014 function FOYChat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) local team = getPlayerTeam(thePlayer) local r, g, b = getPlayerNametagColor(thePlayer) for _, member in ipairs( getPlayersInTeam(team) ) do outputChatBox('#00FF00|FOY Chat| :' .. getPlayerName(thePlayer) .. ': #FFFFFF' .. message, member, r, g, b, true) end end end) addCommandHandler ( "FOYChat", FOYChat ) addEventHandler ( 'onPlayerJoin', getRootElement(), function () bindKey(source,"y","down","chatbox","FOYChat") end) 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