Jump to content

ارقاء اعتائي الحل


z24d

Recommended Posts

local Superman = {} 
  
-- Static global values 
local rootElement = getRootElement() 
local thisResource = getThisResource() 
  
-- Resource events 
addEvent("superman:start", true) 
addEvent("superman:stop", true) 
  
-- 
-- Start/stop functions 
-- 
function Superman.Start() 
  local self = Superman 
  
  addEventHandler("superman:start", rootElement, self.clientStart) 
  addEventHandler("superman:stop", rootElement, self.clientStop) 
end 
addEventHandler("onResourceStart", getResourceRootElement(thisResource), Superman.Start, false) 
  
function Superman.clientStart() 
  setElementData(client, "superman:flying", true) 
end 
  
function Superman.clientStop() 
  setElementData(client, "superman:flying", false) 
end 
  
local groupsTable = { 
    "oneradmin", 
    "Head.Admin", 
    "Console", 
    "big.Admin", 
    "Master", 
    "Moafek", 
    "Sozr", 
    "FDR", 
} 
  
  
addEventHandler("onPlayerLogin", root, 
function(_, acc) 
 local XML = xmlLoadFile ( "Save.xml" ) 
 if XML then 
 local Child = xmlFindChild ( XML, "Ranks", 0 ) 
  if Child  then 
local Get = xmlNodeGetValue ( Child ) 
    local accName = getAccountName(acc) 
    for _, groupName in ipairs(Get) do 
        local group = aclGetGroup(groupName) 
        if group then 
            if isObjectInACLGroup("user."..accName, group) then 
                setElementData(source, "isAdmin", true) 
                break 
               end 
            end 
        end 
    end 
end) 
  

[/lua]

Link to comment

عدل وظيفة تسجيل الدخول

-- # Server Side : 
  
addEventHandler("onPlayerLogin", root, 
function(_,acc) 
 local XML = xmlLoadFile ( "save.xml" ) 
 if XML then 
 local Child = xmlFindChild ( XML, "Group", 0 ) 
  if Child  then 
local Get = xmlNodeGetValue ( Child ) 
    local accName = getAccountName(acc) 
        local group = aclGetGroup(Get) 
        if group then 
            if isObjectInACLGroup("user."..accName, group) then 
                setElementData(source, "isAdmin", true) 
                outputChatBox ("Done",source) 
               end 
            end 
        end 
    end 
end) 

save.xml

    Console

أضف تعريف ملف الأكس أم ال للميتا

"save.xml" /> 
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...