Jump to content

Staff image


SpikeRO3

Recommended Posts

Hello there!

I'm working on a script in which all staff members have an image above

The problem is that : fail to create "aclGetGroup".

Please help me.

imgW = 500 
imgH = 90 
function adminLogo() 
if (isGuestAccount(getPlayerAccount(v)) == false) then 
      accountname = getAccountName (getPlayerAccount(v)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
            local cX, cY, cZ = getCameraMatrix() 
            local hX, hY, hZ = getPedBonePosition(player, -- s8) -->
            hZ = hZ + 0.5 
            local pX,pY,pZ = getPedBonePosition(localPlayer, -- s8) -->
            pZ = pZ + 0.5 
            if getScreenFromWorldPosition(hX, hY, hZ) and isLineOfSightClear(cX,cY,cZ, pX,pY,pZ) then 
                local sX, sY, sD = getScreenFromWorldPosition(hX, hY, hZ) 
                local relative = (50 - sD) / 50 
                if relative > 0 then 
                    local iW = imgW * relative 
                    local iH = imgH * relative 
  
                    local iX = sX - (iW / 2) 
                    local iY = sY - (iH / 2) 
  
                    dxDrawImage(iX, iY, iW, iH, "1.png") 
                end 
            end 
        end 
    end 
end 
addEventHandler("onClientRender", root, adminLogo) 

Link to comment
  • 1 month later...

Try this (not tested)

imgW = 500 
imgH = 90 
admins = "" 
players = getElementsByType ( "player" ) 
function adminLogo() 
    for k,v in ipairs(players) do 
        local accountname = "" 
        if (isGuestAccount(getPlayerAccount(v)) == false) then 
            accountname = getAccountName (getPlayerAccount(v)) 
            if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
                if (admins == "") then 
                    local cX, cY, cZ = getCameraMatrix() 
                    local hX, hY, hZ = getPedBonePosition(player, -- s8) -->
                    hZ = hZ + 0.5 
                    local pX,pY,pZ = getPedBonePosition(localPlayer, -- s8) -->
                    pZ = pZ + 0.5 
                        if getScreenFromWorldPosition(hX, hY, hZ) and isLineOfSightClear(cX,cY,cZ, pX,pY,pZ) then 
                            local sX, sY, sD = getScreenFromWorldPosition(hX, hY, hZ) 
                            local relative = (50 - sD) / 50 
                        if relative > 0 then 
                            local iW = imgW * relative 
                            local iH = imgH * relative  
                            local iX = sX - (iW / 2) 
                            local iY = sY - (iH / 2) 
                            dxDrawImage(iX, iY, iW, iH, "1.png") 
                        end 
                    end 
                end 
            end 
        end 
    end 
end 
addEventHandler("onClientRender", root, adminLogo) 

Link to comment

try using

triggerClientEvent 

you are using this code in client-side, which should not be and 'v' is not defined like player

if (isGuestAccount(getPlayerAccount(v)) == false) then 
      accountname = getAccountName (getPlayerAccount(v)) 
      if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
      end 
end 

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