Jump to content

[HELP] Why not output all teams chat only for admins?


Tokio

Recommended Posts

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 by Tokio
Link to comment

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 by Shux
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...