Jump to content

i need some help


explOdeR

Recommended Posts

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:

Link to comment

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 ?

Link to comment

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 :D

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