Jump to content

ACL


ZeyadGTX

Recommended Posts

HelHelp

I tried that code not working

if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Warden" ) ) then 
  
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  

Link to comment

I added These line in my Nametags and it's client side :

i added that Client side :

local accName = getAccountName ( getPlayerAccount ( player ) )  

Do i add this server side : ?

if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Everyone" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then 
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  
 if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Warden" ) ) then 
  
dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) 
                      end 
  
  

Link to comment

I'm not sure what you're trying to achieve but:

Server:

  
function setDataOnLogin() 
    if not isGuestAccount(getPlayerAccount(source)) and isObjectInACLGroup("user."..getAccountName(source), aclGetGroup("Console")) then 
        setElementData(source, "showimg", true) 
    end 
end 
addEventHandler("onPlayerLogin", root, setDataOnLogin) 
  
function setDataOnResourceStart() 
    for i, v in ipairs(getElementsByType("player")) do 
        if not isGuestAccount(getPlayerAccount(v)) and isObjectInACLGroup("user."..getAccountName(v), aclGetGroup("Console")) then 
            setElementData(v, "showimg", true) 
        end 
    end 
end 
addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) 
  

Client:

  
function showImage() 
dxDrawImage() -- Here will go the rest of your code. 
end 
addEventHandler("onClientResourceStart", resourceRoot, function() addEventHandler("onClientRender", root, showImage) end) 
  

Please not your Lua knowledge is terrible, you don't seem to know even the basics of it, dxDrawImage is a client-sided function and shall not be used server-side, it won't have any effect and will throw an error. I've made you the script, you only need to do the dxDrawImage part, even so I looked through the rest of your stuff and it's just not making any sense, you copied a few lines from another script and came here asking for help.

nameWidth, teamWidth, scale, imageSize,, sy and sx and undefined variables, I don't even know how you expect this to work.

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...