Jump to content

isObjectInACLGroup script problem


wajsic

Recommended Posts

Posted

Hello! I have a problem. I have wrote this script:

  
addCommandHandler ( "wajsic", 
   function (thePlayer) 
        local accountname = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then 
        setElementPosition( thePlayer, 1257.8564453125, -775.72027587891, 92.03125 ) 
        end 
    end 
) 
  

Problem is that I get an error:

\script.lua: attempt to concatenate global 'accountname' (a nil value)

What could it be?

Thanks!

Posted
addCommandHandler ( "wajsic", 
   function (thePlayer) 
        local account = getPlayerAccount ( thePlayer ) 
        if account then 
        local accountname = getAccountName ( account ) 
        if isObjectInACLGroup ( "user." .. tostring(accountname), aclGetGroup ( "admin" ) ) then 
        setElementPosition( thePlayer, 1257.8564453125, -775.72027587891, 92.03125 ) 
           end 
        end 
    end 
) 

Try that.

Btw, you are doing it server side, right?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I found your problem, you put as group: "admin" but it's "Admin" with big A

addCommandHandler ( "wajsic", 
   function (thePlayer) 
        local account = getPlayerAccount ( thePlayer ) 
        if account then 
        local accountname = getAccountName ( account ) 
        if isObjectInACLGroup ( "user." .. tostring(accountname), aclGetGroup ( "Admin" ) ) then 
        setElementPosition( thePlayer, 1257.8564453125, -775.72027587891, 92.03125 ) 
           end 
        end 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Impossible, it's working fine here, are you logged in as "Admin"?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I don't see why it would work here and not in your server.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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