Tokio Posted May 12, 2019 Share Posted May 12, 2019 (edited) i want to output all team's teamchat to admins but does not working.. anyone can help? if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "LathatatlanAdmin" ) ) then local plrTeam = getPlayerTeam ( source ) local teamName = getTeamName(plrTeam) outputChatBox("#00FF01[Csoport chat - "..teamName.."] ".. string.format("#%02X%02X%02X", getPlayerNametagColor(source)) ..""..getPlayerName(source).."#73FF73: "..Upper(message), source, r, g, b, true ) end Edited May 12, 2019 by Tokio Link to comment
justn Posted May 12, 2019 Share Posted May 12, 2019 (edited) Basically you want.. local function outputTeamChatToAdmins(plr,msg) for i,admin in ipairs(getElementsByType("player")) do local plr_teamName = getTeamName(getPlayerTeam(plr)) local accName = getAccountName(getPlayerAccount(admin)) if ( accName ) then if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "LathatatlanAdmin" ) ) then outputChatBox("#00FF01[Csoport chat - "..plr_teamName.."] ".. string.format("#%02X%02X%02X", getPlayerNametagColor(plr)) ..""..getPlayerName(plr).."#73FF73: "..msg, admin, 255,255,255, true ) end end end end local function playerTeamChat(message, messageType) if ( messageType == 2 ) then outputTeamChatToAdmins(source,message) end end addEventHandler("onPlayerChat", root, playerTeamChat) Edited May 12, 2019 by Shux 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