Jump to content

طلب افنت


Recommended Posts

انا اقول كذا راح يصير لاق

افضل طريقة

Client

addEventHandler("onClientElementDataChange", root, function(name) 
    if getElementType(source) == "player" and name == "Admin" then 
        guiSetEnabled(button, getElementData(source, "Admin")) 
    end 
end) 

Server

function Events(_, account) 
    if eventName == "onPlayerLogin" then 
        if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Console")) then 
            setElementData(source, "Admin", true) 
        end 
    elseif eventName == "onPlayerLogout" then 
        setElementData(source, "Admin", false) 
    elseif eventName == "onResourceStart" then 
        for k,v in ipairs(getElementsByType("player")) do 
            local account = getPlayerAccount(v) 
            if account and not isGuestAccount(account) and isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Console")) then 
                setElementData(v, "Admin", false) 
            end 
        end 
    end 
end  
addEventHandler("onPlayerLogin", root, Events) 
addEventHandler("onPlayerLogout", root, Events) 
addEventHandler("onResourceStart", resourceRoot, Events) 
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...