explOdeR Posted July 19, 2012 Posted July 19, 2012 if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then -- if he is admin hey here its my part of my script well i want put in the staff team all ACL mods , smods ,Admins ... and that how i can do it ? function createAdminTeamOnStart () AdminTeam = createTeam ( "Admin", 255, 128, 0 )-- create a new team and named it 'Admin' end addEventHandler("onResourceStart", resourceRoot, createAdminTeamOnStart) -- add an event handler function setAdminTeam() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then -- if he is admin setPlayerTeam(source, AdminTeam) -- set him to admin team end end addEventHandler("onPlayerLogin",getRootElement(),setAdminTeam) -- add an event handler Thats the complete script , please help c:
Wei Posted July 19, 2012 Posted July 19, 2012 if hasObjectPermissionTo( source, "function.kickPlayer" ) then Diet with russian vodka, lose 3 days in one week !
explOdeR Posted July 19, 2012 Author Posted July 19, 2012 its more simple than this bro , i just need a correction function setAdminTeam() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then -- if he is admin setPlayerTeam(source, AdminTeam) -- set him to admin team end isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin, SuperModerator, Moderator")) its good ?
Castillo Posted July 19, 2012 Posted July 19, 2012 No, aclGetGroup only gets from one group name. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Anderl Posted July 19, 2012 Posted July 19, 2012 I wrote this function right now to get group pointeirs by name list: _aclGetGroup = aclGetGroup function aclGetGroup( sGroupList ) if( sGroupList and type( sGroupList ) == 'string' ) then local aGroups = split( string.gsub( sGroupList, ' ', '' ), ',' ); local aGroupPointers = { } for _, v in ipairs( aGroups ) do table.insert( aGroupPointers, _aclGetGroup( v ) ); end return aGroupPointers end return false end It should work that way: local aGroups = aclGetGroup( 'Admin, Moderator' ); Then you can get group pointers that way: aGroups[1] --> Admin group pointer aGroups[2] --> Moderator group pointer Function not tested, it may have some errors, or a lot "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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