Jump to content

aclGetGroup


LucasBaker

Recommended Posts

function freezar(M, _, T) 
        local x1, y1 = getElementPosition(M) 
        for _,Pl in ipairs(getElementsByType("player")) do 
            local x2, y2 = getElementPosition(Pl) 
            local Distance = getDistanceBetweenPoints2D(x1, y1, x2, y2) 
            if (Distance <= 30) then 
            if not ( isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then -- pra não congela os adm 
               toggleAllControls ( Pl, false ) 
               setElementFrozen ( Pl, true ) 
                outputChatBox("#00FFFF[EVENTO] Você foi congelado", Pl, 0, 255, 0, true)  
            end 
        end 
    end 
    end 
addCommandHandler("congelar", freezar) 
  

What I want the function to work for All Less admins but the error value

Link to comment

The error is here:

if ( not isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then 

You aren't obtaining his account name, just the account userdata, you have to use getAccountName:

if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( Pl ) ), aclGetGroup ( "Admin" ) ) ) then 

Link to comment
The error is here:
if ( not isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then 

You aren't obtaining his account name, just the account userdata, you have to use getAccountName:

if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( Pl ) ), aclGetGroup ( "Admin" ) ) ) then 

thx

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