command = "ok" ---- هنا الكلمة الي تفتح بيها اللوحة حقة الاسل
command2 = "formate" --- هذه الكلمة تكتبها بأف8 مسافة اسم الرتبة ( تفرمت كل الي فيها (( تسحب كل االحسابات الي فيها )) )
group = "Manager" ---- هنا الرتبة الي تفتح لها اللوحة حقة الاسل
group2 = "Console" ---- ( الجروب الذي يمكنه الفرمتة (( formate )) )
Table = {}
setElementData(resourceRoot,"log","")---- الكلمة الي تفتح اللوحة حقة مراقبة الاسل يظهر فيها من رقى من وهاكذا الكلمة ( log )))
Days = {
[1] = "الأحد",
[2] = "الاثنين",
[3] = "الثلاثاء",
[4] = "الأربعاء",
[5] = "الخميس",
[6] = "الجمعة",
[7] = "السبت"
}
Months = {
[1] = "يناير",
[2] = "فبراير",
[3] = "مارس",
[4] = "أبريل",
[5] = "ماي",
[6] = "يونيو",
[7] = "يوليوز",
[8] = "غشت",
[9] = "شتنبر",
[10] = "أكتوبر",
[11] = "نونبر",
[12] = "دجنبر"
}
addCommandHandler(command2,function(thePlayer,cmd,name)
if isObjectInACLGroup ("user.".. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup (group2) ) then
if aclGetGroup(name) then
for i,object in pairs(aclGroupListObjects(aclGetGroup(name)))do
aclGroupRemoveObject(aclGetGroup(name),object)
end
outputChatBox("Action executed!",thePlayer,255,255,0,true)
else
outputChatBox("Group not exists!",thePlayer)
end
end
end)
addCommandHandler("log",function(thePlayer)
if isObjectInACLGroup ("user.".. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup (group2) ) then
triggerClientEvent(thePlayer,"returnACLLog",thePlayer)
end
end)
addCommandHandler(command,function(thePlayer)
if isObjectInACLGroup ("user.".. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup (group) ) then
triggerClientEvent(thePlayer,"onOpenACLWindow",thePlayer)
groups = {}
for i,g in ipairs(aclGroupList()) do
if aclGroupGetName(g) ~= "Console" and aclGroupGetName(g) ~= "Admin" then
table.insert(groups,aclGroupGetName(g))
end
end
triggerClientEvent(thePlayer,"returnGROUPSNAMES",thePlayer,groups)
end
end)
addEvent("getGroupObjects",true)
addEventHandler("getGroupObjects",getRootElement(),function(name)
for i,obj in pairs(aclGroupListObjects(aclGetGroup(name)))do
exists = "no"
if string.find(obj,"user.",1) then
nick,last = getAccountPlayerData(string.gsub(obj,"user.",""))
if getPlayerFromAccount(string.gsub(obj,"user.","")) then
exists = "yes"
end
else
nick,last = "NONE","NONE"
end
triggerClientEvent(source,"returnObjects",source,obj,nick,last,exists)
end
end)
function getAccountPlayerData(name)
if Table[name] then
nick,last = Table[name]["nick"],Table[name]["lastTime"]
else
nick,last = "NONE","NONE"
end
return nick,last
end
addEventHandler("onPlayerLogin",getRootElement(),function()
name = getAccountName(getPlayerAccount(source))
nick = getPlayerName(source)
time = getRealTime()
num = tonumber(time.weekday)+1
day = Days[num]
num = tonumber(time.month)+1
month = Months[num]
if string.len(time.minute) == 1 then
minute = tostring("0" .. time.minute .. "")
else
minute = time.minute
end
theTime = tostring("" .. day .. " " .. time.monthday .. "-" .. month .. "-" .. tonumber(time.year)+1900 .. "[" .. time.hour .. ":" .. minute .. "]")
if Table[name] then
Table[name]["nick"] = nick
Table[name]["lastTime"] = theTime
else
Table[name] = {
["nick"] = nick,
["lastTime"] = theTime
}
end
end)
function getPlayerFromAccount(acc)
for i,p in pairs(getElementsByType("player"))do
if tostring(getAccountName(getPlayerAccount(p))) == tostring(acc) then
return true
end end end
addEvent("onManageACL",true)
addEventHandler("onManageACL",getRootElement(),function(action,obj,group)
if action == "remove" then
aclGroupRemoveObject(aclGetGroup(group),obj)
setElementData(resourceRoot,"log",tostring("" .. getElementData(resourceRoot,"log") .. "\n-" .. getPlayerName(source) .. "(" .. getAccountName(getPlayerAccount(source)) .. ") removed object " .. obj .. " from group:" .. group .. ""))
elseif action == "add" then
aclGroupAddObject(aclGetGroup(group),obj)
setElementData(resourceRoot,"log",tostring("" .. getElementData(resourceRoot,"log") .. "\n-" .. getPlayerName(source) .. "(" .. getAccountName(getPlayerAccount(source)) .. ") added object " ..