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