MisterQuestions Posted December 8, 2014 Posted December 8, 2014 Is there anyway to disable team chat for certain teams? "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
MTA Team botder Posted December 9, 2014 MTA Team Posted December 9, 2014 blocked = { ["FiveForty"] = true, ["Querty"] = true } addEventHandler("onPlayerChat", root, function (_, type) if (type == 2) then -- team message local team = getPlayerTeam(source) if (team and blocked[ getTeamName(team) ]) then return cancelEvent() end end end ) GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
MisterQuestions Posted December 9, 2014 Author Posted December 9, 2014 i will check it thanks "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
MisterQuestions Posted December 10, 2014 Author Posted December 10, 2014 Hmm, got a question, if i create a table of teams without permission to teamchat, its okay like this? disabled = {'Team1', 'Team2'} addEventHandler("onPlayerChat", root, function (_, type) if (type == 2) then -- team message local team = getTeamFromName(disabled) if (team) then return cancelEvent() end end end ) "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
Banex Posted December 10, 2014 Posted December 10, 2014 disabled = {'Team1', 'Team2'} addEventHandler("onPlayerChat", root, function (_, type) if (type == 2) then for k,v in pairs(disabled) do local team = getTeamFromName(v) if (team) then return cancelEvent() end end end end) Not worry about the future. Very soon it will come.
.:HyPeX:. Posted December 10, 2014 Posted December 10, 2014 Thats not gonna work, lol. You're cancelling every team! disabled = {'Team1', 'Team2'} addEventHandler("onPlayerChat", root, function (_, type) if (type == 2) then for k,v in pairs(disabled) do local team = getTeamFromName(v) if ( team) and (team==getPlayerTeam(source) ) then return cancelEvent() end end end end ) My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
DiSaMe Posted December 10, 2014 Posted December 10, 2014 But it's more efficient to use the team as table key like Necktrox did rather than loop through the table and check the player's team against every value. -
.:HyPeX:. Posted December 10, 2014 Posted December 10, 2014 But it's more efficient to use the team as table key like Necktrox did rather than loop through the table and check the player's team against every value. Yeah true, i just copied down the code abdove me. My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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