Tokio

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

Recommended Posts

Posted (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 by Tokio

Share this post


Link to post
Posted (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 by Shux

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.