مش عادتك تغلط بشي تافه زي كذا؟؟
aGroup = {
{"Console", "الادارة"},
{"Admin", "مدير"},
{"Level 1", "مشرف"},
{"Level 2", "مشرف2"}
}
function getPlayersHaveRanks()
local ta={}
for k,v in ipairs(getElementsByType('player'))do
for _,j in ipairs(aGroup)do
local account=getPlayerAccount(v)
if isGuestAccount(account) then break end
if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(j[1])) then
table.insert(ta,j)
end
break
end
end
return ta
end
addCommandHandler("Chat",
function(player,_,...)
local message = table["concat"]({...}, " ")
local account = getPlayerAccount(player)
if not isGuestAccount(account) then
for _,value in ipairs(aGroup) do
if aclGetGroup(v[1]) then
if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(v[1])) then
for s,m in ipairs(getPlayersHaveRanks())do
outputChatBox(v[2].." "..getPlayerName(player).." : #FFFFFF"..message, m, 255, 0, 0, true)
end
break
end
end
end
else
outputChatBox("* Please Login !", player, 255, 0, 0, true)
end
end
)
addEventHandler("onResourceStart",root,
function()
for _,Player in ipairs(getElementsByType("player")) do
bindKey(Player, "n", "down", "chatbox", "Chat")
end
end
)