Jump to content

Will this script work??


naz19

Recommended Posts

Will this script work????

adminTeam = createTeam ( "Admins", 255, 0, 0 ) 
  
function getPlayerACLGroup("ACL")    if 
"ACL"=Admin() 
  
function setPlayerAdmin() 
      setPlayerTeam ( source, adminTeam ) 
end 
addEventHandler ( "onPlayerJoin", root, setPlayerAdmin , getPlayerACLGroup ) 

If here is some errors pls show me them)

It's my first script))

Link to comment

Function "getPlayerACLGroup" won't work.

And you don't need "setPlayerAdmin" in event handler :

addEventHandler ( "onPlayerJoin", root, setPlayerAdmin , getPlayerACLGroup ) 

You can separate them:

addEventHandler ( "onPlayerJoin", root , getPlayerACLGroup ) 
addEventHandler ( "onPlayerJoin", root , setPlayerAdmin ) 

Link to comment
Will this script work????
adminTeam = createTeam ( "Admins", 255, 0, 0 ) 
  
function getPlayerACLGroup("ACL")    if 
"ACL"=Admin() 
  
function setPlayerAdmin() 
      setPlayerTeam ( source, adminTeam ) 
end 
addEventHandler ( "onPlayerJoin", root, setPlayerAdmin , getPlayerACLGroup ) 

If here is some errors pls show me them)

It's my first script))

Sorry but you have a lot of errors. This time I will post how you should have done it hoping you can learn by looking at the code

  
adminTeam = createTeam ( "Admins", 255, 0, 0 ) 
function setPlayerAdmin() 
    accountname = getAccountName (getPlayerAccount(source)) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then 
         setPlayerTeam(source, adminTeam) 
    end 
end 
addEventHandler('onPlayerLogin', root, setPlayerAdmin) 
  

Notice onPlayerLogin instead of onPlayerJoin.

When the player joins he will most likely not have logged into his admin account

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