naz19 Posted December 24, 2011 Share Posted December 24, 2011 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
CapY Posted December 24, 2011 Share Posted December 24, 2011 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
BinSlayer1 Posted December 24, 2011 Share Posted December 24, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now