لم يتم التجربهـ .. :
local ChatGroups_ =
{
"Admin",
"SuperModerator",
}
addEventHandler ( "onResourceStart", resourceRoot, function ( )
for _,p in ipairs ( getElementsByType ( "player" ) ) do
bindKey( p, "u", "down", "chatbox", AdminsChat )
end
end )
addEventHandler ( "onPlayerJoin", root, function ( )
bindKey( source, "u", "down", "chatbox", AdminsChat )
end )
addCommandHandler( "AdminsChat", function ( player, _, ... )
if ( not isGuestAccount ( getPlayerAccount ( player ) ) ) then
local Player_acc = getAccountName ( getPlayerAccount ( player ) )
local hisMsg = table.concat ( { ... }, " " )
local hisName = getPlayerName ( player )
for i = 1, #ChatGroups_ do
if ( isObjectInACLGroup( "user."..Player_acc, aclGetGroup ( ChatGroups_ [ i ] ) ) ) then
for _,p in ipairs ( getElementsByType ( "player" ) ) do
if ( not isGuestAccount ( getPlayerAccount ( p) ) ) then
for i = 1, #ChatGroups_ do
if ( isObjectInACLGroup( "user."..getAccountName ( getPlayerAccount ( p ) ), aclGetGroup ( ChatGroups_ [ i ] ) ) ) then
outputChatBox ( "[ Admin ] "..hisName..": #ffffff"..hisMsg, p, 255, 255, 255, true )
end
end
end
end
end
end
end
end )