Author Topic: SANB Adim Chat  (Read 19 times)

Harry

  • Guest
SANB Adim Chat
« on: June 23, 2012, 11:46:57 pm »
to talk use this cmd :/Sanb text
Code: [Select]
function adminChat( thePlayer,_,... )
    local text = table.concat( {...}, " " )
    local name = getPlayerName( thePlayer )
    for _,v in pairs( getPlayersInGroup( accName ) ) do
        outputChatBox ("#00FF00(SANB) "..tostring( name )..": #FFFFFF"..tostring( text ), v, 0, 255, 0, true)
    end
end
addCommandHandler("SANB", adminChat)
   
function getPlayersInGroup( accName )
    local Table = { }
    for _,v in pairs( getElementsByType( "player" ) ) do
    local accName =  getAccountName ( getPlayerAccount ( v ) )
        if (isObjectInACLGroup ("user." .. accName, aclGetGroup("Admin")) ) then
                table.insert( Table,v )   
        end
    end
    return Table
end

Share on Bluesky Share on Facebook